Repository navigation
fix(sync): let sync remove a channel from a group - #1543
Merged
Merged
Conversation
9 of 14 tasks
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
Subscription groups merged
channelIdsas a plain union, so sync could add a channel to a group but never remove one: the other device's copy put it back. Flow-Tube/flow-sync#38 adds per-member stamps, and this implements them:CanonicalSubscriptionGroupcarriesmembers(channelId,hlc,deleted) next tochannelIds, which stays the live list for older apps. It's left out when a group has none, so such records stay byte-identical to before; a test pins the exact wire shape Flow Desktop emits (fix(sync): let sync remove a channel from a group Flow-Desktop#318).SubscriptionsMergermerges members like playlist items: per channel, the newest stamp wins, and a removal is a tombstone. A record withoutmembers(from an older app) counts each of itschannelIdsas present at the record's stamp.SyncChangeTrackertracks members in their own ledger (subscription_members), the same way it tracks playlist items, so removing a channel here goes out as a member tombstone. Its tombstone helper is now shared by playlist items and group members.Related issue
Part of #1075 (linked devices).
Change type
Validation
./gradlew :app:assembleGithubDebug: ok./gradlew :app:testGithubDebugUnitTest: 4570 passed, 46 skipped, 0 failed; newMergeConvergenceTest.a_channel_removed_from_a_group_stays_removed(merge laws with an older app's record, and the byte-exact wire shape); after the follow-up commit, the sync tests (162 passed),ktlintCheckandassembleGithubDebugwere rerun and pass andSyncChangeTrackerTest.a_channel_removed_from_a_group_goes_out_as_a_member_tombstone./gradlew ktlintCheck: okpython3 .github/scripts/nightly_notes.py --check: 31 nightly notes are validTest device and Android version: none (JVM tests)
Risk and compatibility
A backward-compatible record addition. Older Android and Desktop versions ignore
membersand keep the union behavior. One new ledger file, whichreset()clears with the others. Flow Desktop ships the same rule in its own PR.