Update java-server to Ditto SDK 5.0.0 GA#294
Open
Brian Plattenburg (bplattenburg) wants to merge 2 commits into
Open
Update java-server to Ditto SDK 5.0.0 GA#294Brian Plattenburg (bplattenburg) wants to merge 2 commits into
Brian Plattenburg (bplattenburg) wants to merge 2 commits into
Conversation
Bumps com.ditto:ditto-java and com.ditto:ditto-binaries from 5.0.0-java to 5.0.0 GA. The 5.0.0 GA removed the convenience sync methods and the result-bearing form of DittoStore.execute(), so: - ditto.startSync() / stopSync() are now ditto.getSync().start() / stop(). - DittoStore.execute(...) returns CompletionStage<Void> for fire-and-forget writes. To get a DittoQueryResult back for SELECTs, use executeRaw(...). Updated the two SELECT call sites; INSERT/UPDATE call sites that ignored the result are unchanged in behavior. Also updates the README API reference link from the stale v4.11 URL to 5.0.0. Verified locally: ./gradlew check passes (compile + PMD + SpotBugs).
Copilot started reviewing on behalf of
Brian Plattenburg (bplattenburg)
May 28, 2026 00:46
View session
Brian Plattenburg (bplattenburg)
added a commit
that referenced
this pull request
May 28, 2026
Mirrors the same SDK bump being proposed against main (PR #294). 5.0.0 GA removes the convenience sync methods and the result-bearing form of DittoStore.execute(), so: - ditto.startSync() / stopSync() → ditto.getSync().start() / .stop() - DittoStore.execute(...) returns CompletionStage<Void>. For SELECTs that need a DittoQueryResult back, use executeRaw(...). Also fixes the README API reference link (was still pointing at v4.11). Verified locally: ./gradlew check passes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Java server quickstart to Ditto SDK 5.0.0 GA and adapts the code to SDK API changes (sync start/stop API, and DQL execution API changes for SELECT queries).
Changes:
- Bump
com.ditto:ditto-java/com.ditto:ditto-binariesfrom5.0.0-javato5.0.0. - Migrate sync controls from
ditto.startSync()/stopSync()toditto.getSync().start()/stop(). - Switch SELECT call sites from
execute(...)toexecuteRaw(...)and update the README API reference link.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java | Updates SELECT query execution to executeRaw(...) for Ditto v5 GA. |
| java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoService.java | Updates sync start/stop usage and SELECT query execution to executeRaw(...); aligns with new execute(...) return type. |
| java-server/README.md | Updates API reference link to Ditto Java SDK 5.0.0. |
| java-server/build.gradle.kts | Bumps Ditto Java dependencies to 5.0.0 GA. |
Comments suppressed due to low confidence (1)
java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java:56
toggleTaskDoneassumes the SELECT returns at least one row (tasks.getItems().get(0)), which will throwIndexOutOfBoundsExceptionif an invalid/nonexistenttaskIdis posted to/tasks/{taskId}/toggle. Handle the empty result case explicitly (e.g., no-op, return 404/IllegalArgumentException, or similar) before accessing the first item.
DittoQueryResult tasks = dittoService.getDitto().getStore().executeRaw(
"SELECT * FROM %s WHERE _id = :taskId".formatted(TASKS_COLLECTION_NAME),
DittoCborSerializable.Dictionary.buildDictionary()
.put("taskId", taskId)
.build()
).toCompletableFuture().join();
boolean isDone = tasks.getItems().get(0).getValue().get("done").asBoolean();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Brian Plattenburg (bplattenburg)
added a commit
that referenced
this pull request
May 28, 2026
Mirrors the cleanup pattern from PR #294 (java-server) in the offline branch. Drops the explicit websocketURLs assignment (v5's serverConnect() handles cloud sync transport) and the LAN re-defaults (LAN + mDNS are on by default in v5). Keeps the BLE/AWDL disables because those are intentional macOS unsigned-dev-build workarounds, not v4 leftovers. env.ts: drops the now-unused websocketUrl field and removes it from the online-mode missing-env-var check. Done on this branch only to slim CVS's evaluation path; broader cleanup across the other v5 apps is tracked in SDKS-3859.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps
com.ditto:ditto-javaandcom.ditto:ditto-binariesfrom5.0.0-javato5.0.0GA.5.0.0 dropped two convenience surfaces that this app was using:
ditto.startSync()/ditto.stopSync()removed — useditto.getSync().start()/.stop()instead.DittoStore.execute(...)now returnsCompletionStage<Void>(fire-and-forget). For SELECTs that need aDittoQueryResult, useexecuteRaw(...). INSERT/UPDATE call sites that ignored the result are unchanged in behavior.Also fixes the README API reference link, which still pointed at v4.11.
Verified locally:
./gradlew checkpasses (compile + PMD + SpotBugs).