Repository navigation
feat: show a member when a phone is added to their account - #122
Merged
Merged
Conversation
The intergroup's site decides who a member is, so a site that had been broken into could add a phone as any member and receive their messages. Firebase records every change to a member's devices; Link now shows it. After every sync, and when a notice is pushed, the message list shows the newest change that gave another phone access and that this phone hasn't seen: "A new phone was added to your account on <date>. If this wasn't you, contact the intergroup." It stays until the member answers "That was me". A push can be lost, so the check at each sync is what makes sure. Settings has the history: every change, newest first, with this phone marked and changes made by an admin or takeovers that didn't prove the key in red. Android shows the pushed notice on a new "Account security" channel, and iOS as a local notification.
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.
Stage 5, piece 2b. The Functions side is bleedingdeacons/fellowship#76. That PR's rules must be deployed before this build can read anything.
Why
The intergroup's site decides who a member is. A site that had been broken into could add a phone as any member, or re-key one, and receive their messages from then on. That can't be prevented from a phone, so it is made visible. Firebase records every change in
deviceEvents(fellowship#75), and now Link shows it to the member.What changes
enrol,replaceKey,takeOver) and that this phone hasn't seen. For example: "A new phone was added to your account on 28 Nov 2026 at 22:24. If this wasn't you, contact the intergroup." Its buttons are See devices and That was me. It stays until answered.{t: 'device', e, kind}): Android shows it on a new Account security channel,link_account; iOS shows a local notification. The words are lock-screen safe. Tapping opens Link, whose message list shows the warning.IFellowshipClient.FetchDeviceChangesAsync: a FirestorerunQueryondeviceEvents, wherememberId ==this device's member, ordered byatdescending, limit 50 (uses build: move to xunit 4, as Register did #75's index).Limits
Tests
DeviceChanges.feature: 15 scenarios for what is shown and what isn't. I checked they run by breaking an assertion: 7 failed as expected, then I restored it.DeviceChangeTests: push parsing, notification text and keys, banner wording in local time, and each kind's words.FirebaseFellowshipClientTests: the query's shape and mapping, and that a refused or failed read isnull, not an empty record.