Prune stale superseded bot devices on the homeserver after a fresh-store wipe #34
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dark/nether-voicebridge#34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the #30 fix (
84b0a0c).To fix #30, a fresh-store deploy now mints a new unique appservice-bot
device_id(e.g.dark-voice-<rand>) so peers don't reject a reused id whose keys changed. The previously-minted device is never removed, so@voicebridge_asaccumulates one stale device per fresh wipe/redeploy.as_token-masqueradedDELETE /_matrix/client/v3/devices/{id}(handle UIA), or periodically prune inactive devices.Live-proven motivation (2026-07-02). Stale ghost-device accumulation directly causes persistent per-publisher silence on encrypted calls: a listener's device list held ~10 devices for a single ghost MXID (5
C…crypto — one per bridge run, never deleted — + 5 old-saltD…call devices) and ~23 for@voicebridge_as. This poisons the device list (InvalidSignature/SigningKeyChangedon stale devices) and drains the listener's one-time keys → the ghost→listener Olm session wedges onMissingOneTimeKey→ that speaker is inaudible until the ghost's device changes. Pruning to one current device per MXID at startup is the fix. See #52 for the wedge mechanism and the deferred self-heal path.Spike result (2026-07-02): Tuwunel blocks CS-API device deletion for appservice users — #34-by-deletion is a dead end on this homeserver. Built
prune_stale_devices(enumerate own devices, keep current, delete the rest) and tested live: the ghost's own token needs a JSON body onDELETE /devices/{id}(elseM_NOT_JSON), and with{}returns 401 with an EMPTYflows:[]— no UIA stage a passwordless appservice user can complete.as_token+?user_id=masquerade returns 403 M_FORBIDDEN ("user must be authenticated and device identified"). No auth variant deletes. Pivot to #35 (stop minting a fresh crypto device per run so nothing accumulates — needs a light persistent identity). The existing backlog (~hundreds of stale devices already on the HS) will need a one-time Tuwunel admin cleanup, since CS-API deletion is unavailable. See #52 for the wedge mechanism this feeds.Done via #53, released v0.3.0-alpha.3 (master
436a5af), deployed to prod 2026-07-04. What shipped is stronger than the original ask:Caveat, documented in #53: nether.im's current Tuwunel build exposes no device deletion for appservice users, so prunes soft-fail there today (logged, harmless). Latest Tuwunel has MSC4190 — a homeserver upgrade activates the deletions, which is exactly what the code was designed for. Closing.