Drop redundant transport config from java-server quickstart#291
Merged
Brian Plattenburg (bplattenburg) merged 1 commit intoMay 28, 2026
Merged
Conversation
The v5 Java SDK derives the cloud-sync transport from the URL passed to DittoConfig.Builder.serverConnect(...). The explicit config.connect().websocketUrls().add(...) call was a v4-era leftover and is no longer needed. The config.peerToPeer() block re-enabled BLE and LAN, which are SDK defaults in v5. LAN with mDNS is already on. Re-enabling BLE on a server peer is wrong: headless hosts have no Bluetooth radio, so the call is either dead weight or a likely source of hangs/exceptions inside the transport-config lambda. Per the canonical v5 init at https://docs.ditto.live/sdk/latest/install-guides/java/server, updateTransportConfig is not part of the standard server initialization. Removing both blocks lets the SDK use its defaults.
Copilot started reviewing on behalf of
Brian Plattenburg (bplattenburg)
May 27, 2026 20:02
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies the Java server quickstart’s Ditto initialization by relying on the v5 serverConnect(...) transport defaults instead of manually mutating transport configuration.
Changes:
- Removes the explicit WebSocket URL transport configuration.
- Removes explicit BLE and LAN peer-to-peer transport toggles.
- Removes startup logging of the transport config block that no longer exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
Kristopher Johnson (kristopherjohnson)
approved these changes
May 27, 2026
Brian Plattenburg (bplattenburg)
added a commit
that referenced
this pull request
May 28, 2026
Brings the Android Kotlin (#239), React Native (#267), and Rust TUI (#242) v5 migrations into the offline branch, and re-applies the DITTO_OFFLINE_LICENSE_TOKEN switch on top of each migrated app's new v5 init code per docs/offline-mode-followup-for-v5-migration-prs.md. Also pulls in PR #291 (java-server transport-config cleanup), which is a no-op here since the offline branch already removed the same block in commit 0231678. Per-app notes: - android-kotlin/TasksApplication.kt: rewritten on top of Aaron's v5 init using DittoConfig + DittoHandler.initialize(...). Drops the v4-only updateTransportConfig websocket block since v5's serverConnect() handles it. Removes DITTO_WEBSOCKET_URL from BuildConfig and the env-vars required-for-online check. - react-native/App.tsx: drops the explicit websocketURLs transport config (v4 leftover); the offline switch wraps the existing setExpirationHandler block from #267 with the offline-mode guard. env.d.ts loses DITTO_WEBSOCKET_URL, keeps DITTO_OFFLINE_LICENSE_TOKEN. - react-native-expo/types/env.d.ts: keeps both DITTO_WEBSOCKET_URL and DITTO_OFFLINE_LICENSE_TOKEN — expo isn't migrated to v5 yet, so the existing transport-config block in App.tsx still references the URL. - rust-tui/src/bin/main.rs: rewritten on top of Aaron's v5 init using DittoConfig::new + DittoConfigConnect::{Server, SmallPeersOnly}. Drops websocket_url from try_init_ditto entirely (no longer needed for v5 server connect). The websocket_url Cli arg stays because TuiTask still displays it. Flutter #237 is still open upstream, so the flutter_app changes from the offline branch remain on the v4 SDK path until that migration lands. Verified builds: ./gradlew assembleDebug (android-kotlin), npx tsc --noEmit (react-native), cargo test (rust-tui).
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.
v5's
serverConnect(endpoint)already wires the cloud-sync transport from the URL it's given, so theconnect().websocketUrls().add(...)block is v4 leftover. ThepeerToPeer()block re-enables BLE and LAN, which v5 turns on by default, and BLE has no business on a server peer anyway.Canonical v5 init doesn't include
updateTransportConfigat all: https://docs.ditto.live/sdk/latest/install-guides/java/serverLeaving
DITTO_WEBSOCKET_URLin.env.samplesince other quickstarts still reference it. Cross-app audit to follow.