Skip to content

Commit

Permalink
bugfix: Getting last sequence_num on empty journal results to NPE (#63)
Browse files Browse the repository at this point in the history
* fix: NPE on empty journal

* chore: fix typo in documentation
  • Loading branch information
florian-tirard authored Jan 29, 2024
1 parent 554292e commit 24606de
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target
.DS_Store
.bloop
.java-version
*.iml

# Ignore Gradle build output directory
build
2 changes: 1 addition & 1 deletion docs/manual/advanced/aggregatestore.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h1><a href="#aggregate-store" name="aggregate-store" class="anchor"><span class

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/advanced/event-ordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ <h1><a href="#custom-message-ordering" name="custom-message-ordering" class="anc

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/advanced/event-replay.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h1><a href="#event-replay" name="event-replay" class="anchor"><span class="anch

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/advanced/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h1><a href="#advanced-use-cases" name="advanced-use-cases" class="anchor"><span

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/advanced/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h1><a href="#warning-info-messages" name="warning-info-messages" class="anchor"

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/advanced/multi-command.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ <h1><a href="#multiple-command-handling-in-the-same-transaction" name="multiple-

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/banking.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ <h2><a href="#complete-example" name="complete-example" class="anchor"><span cla

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/database-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h1><a href="#database-configuration" name="database-configuration" class="ancho

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/eventually-consistent-projection.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h1><a href="#eventually-consistent-projections" name="eventually-consistent-pro

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
6 changes: 3 additions & 3 deletions docs/manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h2><a href="#installation" name="installation" class="anchor"><span class="anch
&lt;dependencies&gt
&lt;dependency&gt;
&lt;groupId&gt;fr.maif&lt;/groupId&gt;
&lt;artifactId&gt;common-events&lt;/artifactId&gt;
&lt;artifactId&gt;commons-events&lt;/artifactId&gt;
&lt;version&gt;${thoth.version}&lt;/version&gt;
&lt;/dependency&gt
&lt;dependency&gt;
Expand Down Expand Up @@ -212,7 +212,7 @@ <h2><a href="#installation" name="installation" class="anchor"><span class="anch
ThothVersion: "0.1.0*"
]
dependencies {
implementation "fr.maif:common-events:${versions.ThothVersion}"
implementation "fr.maif:commons-events:${versions.ThothVersion}"
implementation "fr.maif:thoth-core-akka:${versions.ThothVersion}"
implementation "fr.maif:thoth-core-reactor:${versions.ThothVersion}"
implementation "fr.maif:thoth-jooq:${versions.ThothVersion}"
Expand Down Expand Up @@ -327,7 +327,7 @@ <h2><a href="#installation" name="installation" class="anchor"><span class="anch

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/kafka-consumption.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ <h2><a href="#consume-events" name="consume-events" class="anchor"><span class="

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ <h2><a href="#usage" name="usage" class="anchor"><span class="anchor-link"></spa

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/non-blocking/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ <h1><a href="#non-blocking-jooq-implementation" name="non-blocking-jooq-implemen

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/non-blocking/projections-non-blocking.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ <h2><a href="#the-end" name="the-end" class="anchor"><span class="anchor-link"><

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/resilient-kafka-consumption.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h2><a href="#status-and-lifecycles" name="status-and-lifecycles" class="anchor"

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/standard/banking-real-life.html
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ <h2><a href="#usage" name="usage" class="anchor"><span class="anchor-link"></spa

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/standard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ <h1><a href="#standard-jooq-kafka-implementation" name="standard-jooq-kafka-impl

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/standard/projections.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ <h2><a href="#eventually-consistent-projections" name="eventually-consistent-pro

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/technical-considerations.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h1><a href="#technical-considerations" name="technical-considerations" class="a

<!--
<div class="copyright">
<span class="text">&copy; 2022</span>
<span class="text">&copy; 2024</span>
<a href="https://www.example.com" class="logo">logo</a>
</div>
-->
Expand Down
2 changes: 1 addition & 1 deletion thoth-documentation/src/main/paradox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This documentation focuses on implementing event-sourcing on a simple use case :
@@dependency[sbt,Maven,Gradle] {
symbol="ThothVersion"
value="$project.version.short$"
group="fr.maif" artifact="common-events" version="ThothVersion"
group="fr.maif" artifact="commons-events" version="ThothVersion"
group2="fr.maif" artifact2="thoth-core-akka" version2="ThothVersion"
group3="fr.maif" artifact3="thoth-core-reactor" version3="ThothVersion"
group4="fr.maif" artifact4="thoth-jooq" version4="ThothVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public CompletionStage<Long> lastPublishedSequence() {
.from(table(this.tableNames.tableName))
.where(PUBLISHED.eq(true))
.fetchAsync(executor)
.thenApply(r -> r.getValues("max", Long.class).stream().findFirst().orElse(0L));
.thenApply(r -> r.getValues("max", Long.class).stream().filter(Objects::nonNull).findFirst().orElse(0L));
}

@Override
Expand Down

0 comments on commit 24606de

Please sign in to comment.