-
Notifications
You must be signed in to change notification settings - Fork 6
refactor(java-server): upgrade to ditto-java 5.0.0-java-rc.2
#223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades the ditto-java SDK from version 5.0.0-preview.3 to 5.0.0-java-rc.2, which introduces a breaking API change renaming DittoError to DittoException. The refactoring updates exception handling throughout the codebase to accommodate this change.
Key changes:
- Updated ditto-java dependency versions in build configuration
- Renamed all
DittoErrorreferences toDittoExceptionin exception handling blocks - Modified
itemToTaskmethod to declarethrows DittoExceptionand added exception handling in its caller
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| build.gradle.kts | Updated ditto-java and ditto-binaries dependencies from 5.0.0-preview.3 to 5.0.0-java-rc.2, including commented examples |
| DittoService.java | Replaced all DittoError catch blocks with DittoException (5 occurrences) |
| DittoTaskService.java | Updated exception handling from DittoError to DittoException, modified itemToTask signature, and refactored observeAll method's error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| .toCompletableFuture() | ||
| .join(); | ||
| } catch (Error e) { |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addTask method should catch DittoException in addition to Error for consistency with the SDK upgrade. The toggleTaskDone method at line 92 correctly catches both Error | DittoException, and this pattern should be applied here as well since the Ditto store operations can throw DittoException.
java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java
Show resolved
Hide resolved
java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java
Outdated
Show resolved
Hide resolved
java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java
Outdated
Show resolved
Hide resolved
…service/DittoTaskService.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoService.java # java-server/src/main/java/com/ditto/example/spring/quickstart/service/DittoTaskService.java
157d1a8 to
44e56cb
Compare
Version
5.0.0-java-rc.2of the Java SDK changed the API, renamingDittoErrortoDittoException.