A signing envelope reaches a group admin two ways at once. The room way
arrives inside storeNostrEvent's transaction, already holding Room's one
writer, and then waits for ConfederationSigningManager's mutex. The inbox
way took the mutex first and then waited for the writer. Each held what
the other wanted, and with Room's acquire timeout set to log, every other
write on the device queued behind them for good: chats and group details
stopped loading on every admin while a proposal was being signed.
propose, receive and resumeRunning now go through locked(), which takes
the writer before the mutex. On the room way the writer is re-entered;
on the inbox way it is waited for first. Holding the connection opens no
transaction, so each write still commits on its own, and nothing under
the lock goes to the network.
The new test hears one envelope both ways at once, holding the inbox way
just past the lock (lockedForTest) until the room way holds the writer.
With the old order it deadlocks and fails after 30 seconds; with this one
both file the round.
jvmTest 2,015, all passing; m3, brand and wallet audits pass;
compileDebugKotlinAndroid builds. Installed on three emulators, with no
writer timeouts after launch; no signing round run on them yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>