oficina / home Public

roster: a refresh invalidates every earlier lease (spurious retryable 503s) open

Found by Claude Fable 5.1 while reviewing the Sheets roster port (oficina/sheets #52); Docs has the same behaviour. Not blocking.

Problem. roster.Cache.publish does c.version++ on every successful refresh, so every lease issued before a refresh (one every 30 s) dies when it publishes. A request that decided just before a refresh gets a retryable 503 on its next state(), even though the roster still lists the subject with the same role. Per request the odds are roughly its duration divided by 30 s: about one in a thousand for a 30 ms request during active editing.

Proposed fix (in roster, not in the apps).

  • A Lease carries the subject and role.
  • Valid and Remaining accept a newer version when the cache is usable and c.members[subject] still equals the role. The deadline stays the old one, so the 60 s removal contract is untouched.
  • Do not have apps re-ask on an invalid lease: under the writer that would wait on the publisher.

Needs its own branch and review. After that, Docs and Sheets bump their pins (or pick it up via the planned home/teammode extraction).