Skip to content

Commit 2d5cee3

Browse files
os-litantclaude
andauthored
docs(core,service-cluster): retire the two docblocks left stale by IPubSub's corrected delivery guarantee (#12836) (#12954)
#12651 corrected IPubSub's contract docblock to state delivery driver-relatively: no shipped driver exceeds at-most-once, a missed message is EXPECTED, handlers must be idempotent AND tolerate loss. Two docblocks elsewhere still described the pre-#12651 world. - packages/core/src/security/authz-invalidation-channel.ts: the 'known contradiction' paragraph asserted in the present tense that the interface docblock 'still says' At-least-once, and that repairing it was filed separately. That filing landed, so the paragraph is now false, not merely stale. Replaced with a plain pointer to the interface docblock; the rest of the docblock is unchanged. - packages/services/service-cluster/src/memory/pubsub.ts: 'At-least-once semantics held vacuously' was wrong on its own terms even before #12651 -- handler errors are swallowed via onError, so a throwing handler loses the message with no retry and no persistence. Replaced with the honest statement. Prose only. No behaviour change. Claude-Session: https://claude.ai/code/session_0194kbQJxUvv2yvsGRtuXpP5 Co-authored-by: Claude <noreply@anthropic.com>
1 parent fa5d137 commit 2d5cee3

3 files changed

Lines changed: 46 additions & 8 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
"@objectstack/core": patch
3+
"@objectstack/service-cluster": patch
4+
---
5+
6+
docs(core,service-cluster): retire the two docblocks left stale by `IPubSub`'s corrected delivery guarantee (#12836)
7+
8+
#12651 corrected `IPubSub`'s contract docblock: delivery is whatever the
9+
configured driver declares, no shipped driver exceeds at-most-once, a missed
10+
message is EXPECTED, and handlers must be idempotent **and** tolerate loss.
11+
Two docblocks elsewhere still described the world before that correction.
12+
13+
**`@objectstack/core``security/authz-invalidation-channel.ts`.** It carried a
14+
paragraph asserting, in the present tense, that the interface docblock "still
15+
says" *At-least-once delivery*, and that repairing it was a `packages/spec`
16+
change filed separately. That filing was #12651 and it has landed, so the
17+
paragraph is now false rather than merely stale — it sends the next reader
18+
looking for a live disagreement between the interface and the drivers that no
19+
longer exists. Replaced with a plain pointer to the interface docblock.
20+
Everything else in that docblock is unchanged: the at-most-once reasoning, the
21+
TTL-is-the-bound rule, and the best-effort-at-the-publish-site note all still
22+
hold.
23+
24+
**`@objectstack/service-cluster``memory/pubsub.ts`.** The line "At-least-once
25+
semantics held vacuously (a single in-process delivery)" was wrong on its own
26+
terms even before #12651: the same docblock states that handler errors are
27+
swallowed and logged via `onError`, so a handler that throws loses the message
28+
with no retry and no persistence. That is not at-least-once in any sense, and
29+
"vacuously" does not save it. Replaced with the honest statement — one
30+
synchronous in-process delivery attempt per subscriber, no persistence, no
31+
retry, no replay.
32+
33+
Prose only. No behaviour change, and no test changed.

packages/core/src/security/authz-invalidation-channel.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@
4242
* write that triggered it. A grant revocation must not fail because a cache
4343
* hint could not be delivered — the TTL already covers exactly that case.
4444
*
45-
* ⚠️ Known contradiction in the surrounding docs, recorded so nobody resolves it
46-
* the wrong way: `IPubSub`'s own interface docblock
47-
* (`@objectstack/spec/contracts`) still says *"At-least-once delivery"*, which
48-
* no shipped driver provides. `cluster.mdx` §4.2 and the redis driver are the
49-
* measured statements and are the ones this module follows. Repairing that
50-
* docblock is a `packages/spec` change and is filed separately, deliberately
51-
* not made here.
45+
* `IPubSub`'s own interface docblock (`@objectstack/spec/contracts`) states the
46+
* same thing from the contract side — delivery is whatever the configured
47+
* driver declares, no shipped driver exceeds at-most-once, and handlers must be
48+
* idempotent **and** tolerate loss. That docblock, `cluster.mdx` §4.2 and the
49+
* redis driver agree; there is no disagreement here for a later reader to go
50+
* looking for.
5251
*
5352
* ## Why a new channel on the existing bus, and not a new transport
5453
*

packages/services/service-cluster/src/memory/pubsub.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ import type {
1515
* - Synchronous fan-out: every subscriber's handler is invoked in the
1616
* same tick that `publish()` resolves. Handler errors are swallowed
1717
* and logged via `onError` (so one bad subscriber can't poison the bus).
18-
* - At-least-once semantics held vacuously (a single in-process delivery).
18+
* - Delivery is at-most-once: one synchronous in-process attempt per
19+
* subscriber, with no persistence, no retry and no replay. A handler that
20+
* throws loses that message outright — the error is swallowed above and
21+
* nothing redelivers it — and a publish to a channel nobody is subscribed
22+
* to at that moment is a silent no-op. This matches what `IPubSub`
23+
* documents: no shipped driver exceeds at-most-once, so handlers must be
24+
* idempotent **and** tolerate loss.
1925
* - No cross-process delivery — use the redis/postgres/nats driver for
2026
* real multi-node setups.
2127
*/

0 commit comments

Comments
 (0)