fix(realtime): subscribe_proxy own-user channel aim2be:user: → user: #5

Merged
hibryda merged 1 commit from fix/subscribe-channel-user-namespace into main 2026-06-01 12:51:36 +02:00
Owner

Header

realtime-service • Stage B slice-1 • subscribe_proxy channel-convention fix

TL;DR

NEEDS_REVIEWUSER_CHANNEL_PREFIX aim2be:user:user:. The own-user channel aim2be:user:<uid> resolved to an unconfigured Centrifugo aim2be namespace (subscribe → error 102); the deployed config exposes a single-segment user namespace, so the channel is user:<uid>.

Summary

First real Centrifugo WS client run (this slice) surfaced the mismatch: Centrifugo namespace names can't contain the : boundary, so aim2be:user:<uid> → namespace aim2be (unconfigured) → unknown channel. The deployed Centrifugo overlay has 6 single-segment namespaces (user/family/chat/parental/flowcoach/admin), each subscribe_proxy-enabled. Operator-decided the deployed model is canonical → own-user channel is user:<uid>.

Findings (changes)

File Change
src/handlers/subscribe.ts USER_CHANNEL_PREFIX aim2be:user:user: + doc comments
src/types.ts denied_channel doc comment
src/server.ts route comment
tests/handlers.subscribe.test.ts doc + denied_channel fixture aim2be:family:fam-1family:fam-1

The authorization logic is prefix-relative (startsWith + slice), so own-user allow / foreign / degraded / malformed semantics are unchanged.

Verdict

NEEDS_REVIEW. tsc --noEmit clean; 133/133 vitest green. Connect path already proven live (real websocat client → connect_proxy → identity Validate); this unblocks the subscribe leg.

realtime-service • PR R0 (author) • channel-contract fix • 2026-06-01

## Header realtime-service • Stage B slice-1 • subscribe_proxy channel-convention fix ## TL;DR **NEEDS_REVIEW** — `USER_CHANNEL_PREFIX` `aim2be:user:` → `user:`. The own-user channel `aim2be:user:<uid>` resolved to an unconfigured Centrifugo `aim2be` namespace (subscribe → error 102); the deployed config exposes a single-segment `user` namespace, so the channel is `user:<uid>`. ## Summary First real Centrifugo WS client run (this slice) surfaced the mismatch: Centrifugo namespace names can't contain the `:` boundary, so `aim2be:user:<uid>` → namespace `aim2be` (unconfigured) → `unknown channel`. The deployed Centrifugo overlay has 6 single-segment namespaces (`user`/family/chat/parental/flowcoach/admin), each subscribe_proxy-enabled. Operator-decided the deployed model is canonical → own-user channel is `user:<uid>`. ## Findings (changes) | File | Change | |---|---| | `src/handlers/subscribe.ts` | `USER_CHANNEL_PREFIX` `aim2be:user:`→`user:` + doc comments | | `src/types.ts` | `denied_channel` doc comment | | `src/server.ts` | route comment | | `tests/handlers.subscribe.test.ts` | doc + `denied_channel` fixture `aim2be:family:fam-1`→`family:fam-1` | The authorization logic is prefix-relative (`startsWith` + `slice`), so own-user allow / foreign / degraded / malformed semantics are unchanged. ## Verdict **NEEDS_REVIEW.** `tsc --noEmit` clean; 133/133 vitest green. Connect path already proven live (real websocat client → connect_proxy → identity Validate); this unblocks the subscribe leg. ## Footer realtime-service • PR R0 (author) • channel-contract fix • 2026-06-01
The own-user channel was `aim2be:user:<uid>`, but Centrifugo namespace names
cannot contain the `:` boundary, so that channel resolves to an unconfigured
`aim2be` namespace (subscribe -> error 102 "unknown channel"). The deployed
Centrifugo config exposes a single-segment `user` namespace (subscribe_proxy +
publish_proxy enabled, alongside family/chat/parental/flowcoach/admin), so the
own-user channel is `user:<uid>`. Aligned USER_CHANNEL_PREFIX + doc comments +
the denied_channel test fixture (aim2be👪fam-1 -> family:fam-1). The
authorization logic is prefix-relative so semantics are unchanged (own-user
allow, foreign/degraded/malformed deny).

Operator-decided 2026-06-01 (channel-convention contract: the deployed 6
single-segment namespaces are the source of truth; the design's `aim2be:user:`
notation was incompatible with Centrifugo's namespace model).

Verification: tsc --noEmit clean; 133/133 vitest green.

hib-pr-reviewer review — PR #5 (affinity-intelligence-rework/im2be-realtime-service)

Round 1 — head 094da55bfcc3, base main, trigger opened

TL;DR: NO_NEW_FINDINGS — No new findings this round.

Summary

[quorum-converged] A=0 = B=0. ## Summary

This PR corrects the Centrifugo own-user channel prefix from aim2be:user: to user:. The explanation in the JSDoc is accurate: Centrifugo namespace names cannot contain :, so aim2be:user:xyz would resolve to the aim2be namespace (unconfigured) rather than the intended user namespace.

Verification performed:

  • All references to USER_CHANNEL_PREFIX in handler, types, server, and test files are consistently updated.
  • The only remaining aim2be:user: in subscribe.ts (lines 45–46) is intentional — it appears in the docblock as a negative example ("NOT aim2be:user:<uid>").
  • grep aim2be:user: across the repo returns only that one explanatory comment — no stale code references.
  • The updated test case (family:fam-1 instead of aim2be:family:fam-1) correctly exercises the denied_channel path under the new prefix.
  • All positive-path tests use USER_CHANNEL_PREFIX via the constant, so the fix propagates automatically.

No actionable findings.

CI status (head 094da55bfcc3)

No CI checks reported for this commit.

Findings

No new findings this round.

Quorum converged on empty findings (A + B both returned 0).

Verdict

NO_NEW_FINDINGS


hib-pr-reviewer • round 1 • 0 findings • 2026-06-01T10:29:20.128Z → 2026-06-01T10:30:32.148Z • posted-as: pr-reviewer-bot • model: auto • [bookkeeping fallback]

<!-- hib-pr-reviewer round:1 --> ## hib-pr-reviewer review — PR #5 (affinity-intelligence-rework/im2be-realtime-service) **Round 1** — head `094da55bfcc3`, base `main`, trigger `opened` **TL;DR:** NO_NEW_FINDINGS — No new findings this round. ### Summary [quorum-converged] A=0 = B=0. ## Summary This PR corrects the Centrifugo own-user channel prefix from `aim2be:user:` to `user:`. The explanation in the JSDoc is accurate: Centrifugo namespace names cannot contain `:`, so `aim2be:user:xyz` would resolve to the `aim2be` namespace (unconfigured) rather than the intended `user` namespace. **Verification performed:** - All references to `USER_CHANNEL_PREFIX` in handler, types, server, and test files are consistently updated. - The only remaining `aim2be:user:` in `subscribe.ts` (lines 45–46) is intentional — it appears in the docblock as a negative example ("NOT `aim2be:user:<uid>`"). - `grep aim2be:user:` across the repo returns only that one explanatory comment — no stale code references. - The updated test case (`family:fam-1` instead of `aim2be:family:fam-1`) correctly exercises the `denied_channel` path under the new prefix. - All positive-path tests use `USER_CHANNEL_PREFIX` via the constant, so the fix propagates automatically. No actionable findings. ### CI status (head `094da55bfcc3`) _No CI checks reported for this commit._ ### Findings **No new findings this round.** _Quorum converged on empty findings (A + B both returned 0)._ ### Verdict **NO_NEW_FINDINGS** --- <sub>hib-pr-reviewer • round 1 • 0 findings • 2026-06-01T10:29:20.128Z → 2026-06-01T10:30:32.148Z • posted-as: pr-reviewer-bot • model: auto • [bookkeeping fallback]</sub>
hibryda deleted branch fix/subscribe-channel-user-namespace 2026-06-01 12:51:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
affinity-intelligence-rework/im2be-realtime-service!5
No description provided.