Files
archie/internal
sam 44d43ef286 fix(gateway): claim the session slot before writing it, not after
resolve saved a newly created session to the store and only then asked
the cache who had won a concurrent race. The loser had already persisted
a session that nothing pointed at: unreachable, but still listed by
/topic and /sessions as "(untitled)", and -- now that resolution goes by
recency -- resurrectable on a later restart. Confirmed by forcing the
interleaving: the store held 2 sessions where it should hold 1.

The claim now happens under the same double-check, ahead of the store
write, so only the winner writes. A failed Save releases the claim, or
the cache would point every later message in that chat at a session that
was never stored.

Refs archie-core-x35
2026-08-04 22:17:39 +10:00
..
2026-07-28 18:46:50 +10:00
2026-08-04 01:45:36 +10:00