Repository navigation
Stop for good when the server says device_removed (GRYT-1555) - #27
Merged
Merged
Conversation
Every transport call now goes through a guard. When a reply is
device_removed, the driver marks itself removed, fires the new
events.onDeviceRemoved once, and throws MlsDriverError("device_removed").
After that it sends the server nothing at all, so nothing can publish
KeyPackages and register this device again.
A removed device that's online finds out straight away. The server
pushes mls:devices:changed to your own sockets too, and when a push
names you, the driver syncs first. A removed device gets refused there.
The test is the stolen-phone case. The laptop removes the phone while
it's online. The phone hears about it from the push. Its next start
sends nothing. A fresh driver on the same state sends one sync, is
refused and never publishes. The peer's next message reaches the laptop
and no Welcome is made for the phone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
The driver's half of GRYT-1555. The server half is Gryt-chat/server#249, which refuses every
mls:*call from a removed device id withdevice_removed.What changes
device_removed, the driver:events.onDeviceRemoved(), onceMlsDriverErrorwith codedevice_removedmls:devices:changedto your own sockets too, so when a push names you,handleDevicesChangedsyncs first, and a removed device gets refused there.onDeviceRemovedsays what the app does: wipe this server's MLS state, and don't make a new device until the person asks. Client#713 and mobile#271 do that.Test
The stolen-phone case, against the fake delivery service, which now keeps removed ids the way server#249 does:
start()sends the server nothing.sync, gets refused and never publishes.I checked that the test fails without the sync on your own push, and fails if the event isn't fired.
What to look at
syncon everymls:devices:changedthat names you. It's one small request, and only on a device that's registered.ownDevices()on a removed device now throwsdevice_removedinstead of listing. The apps show the removed line in that case.Released together with core#25 as 0.13.0, and the apps pin that.
🤖 Generated with Claude Code