Add sync group and routing hint based on location#80
Open
Brian Plattenburg (bplattenburg) wants to merge 3 commits into
Open
Add sync group and routing hint based on location#80Brian Plattenburg (bplattenburg) wants to merge 3 commits into
Brian Plattenburg (bplattenburg) wants to merge 3 commits into
Conversation
8b1ac69 to
1f0f1dc
Compare
f2f4632 to
275ff23
Compare
da6dac1 to
071230b
Compare
Brian Plattenburg (bplattenburg)
added a commit
that referenced
this pull request
Apr 30, 2026
Resolved conflicts: - iOS DittoService.swift (DittoInstance.init): folded #80's setRoutingConfig logic into the existing transport config block. Reads Settings.locationId at init and sets syncGroup/routingHint before sync starts. DittoInstance now owns initial Ditto configuration; DittoService still handles dynamic stop/setRoutingConfig/start when location changes. - iOS DittoService.swift (DittoService.init): dropped #80's pre-startSync routing block; sync starts in DittoInstance.init via #82, with routing already applied above. - iOS SettingsModel.swift: kept #80's removal of the storedCustomLocation/customLocationPublisher extension. Custom locations are removed in this PR.
This was referenced May 1, 2026
Member
Author
|
@getditto/commercial-solutions I'm closing this but keeping the branch if we ever need this sample code. |
Member
Author
|
Re-opening with the primary goal of removing custom locations |
- Configure syncGroup and routingHint from numeric location ID so devices at the same location form an isolated peer-to-peer mesh and the Big Peer co-locates their data efficiently - Remove the custom location feature — demo locations only - Simplify location setup flow on both platforms
a52f72f to
8a8ea2f
Compare
- README: rewrite Location selection to reflect demo-only locations and document sync group / routing hint behavior - SettingsModel: drop comment about user-defined locations - strings.xml: remove unused button_demo_locations - Kotlin: re-order imports in files touched by the rebase to satisfy ktlint
The location-switch trigger point on each platform was calling two functions back-to-back — set routing, then set up subscriptions. The routing config is conceptually part of "activate this location," so move it inside that function on both platforms. iOS also drops a redundant init-time routing call now that the sink covers it.
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.
Summary
syncGroupandroutingHintfrom the selected location ID so devices at the same location form an isolated peer-to-peer mesh and the Big Peer co-locates their data efficientlyBreaking change
This sets a non-default
syncGroup, so devices running this build will not form a mesh with older builds that use the default sync group (0). All devices in a demo need to be on this version or later.Why remove custom locations?
syncGroupandroutingHintrequire aUInt32. Demo location IDs are already numeric ("00001"–"00007") and parse directly. Custom locations used string IDs ("companyName-locationName") that would need a cross-platform hash — unnecessary complexity for a demo app.