fix(realtime): subscribe_proxy own-user channel aim2be:user: → user: #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/subscribe-channel-user-namespace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Header
realtime-service • Stage B slice-1 • subscribe_proxy channel-convention fix
TL;DR
NEEDS_REVIEW —
USER_CHANNEL_PREFIXaim2be:user:→user:. The own-user channelaim2be:user:<uid>resolved to an unconfigured Centrifugoaim2benamespace (subscribe → error 102); the deployed config exposes a single-segmentusernamespace, so the channel isuser:<uid>.Summary
First real Centrifugo WS client run (this slice) surfaced the mismatch: Centrifugo namespace names can't contain the
:boundary, soaim2be:user:<uid>→ namespaceaim2be(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 isuser:<uid>.Findings (changes)
src/handlers/subscribe.tsUSER_CHANNEL_PREFIXaim2be:user:→user:+ doc commentssrc/types.tsdenied_channeldoc commentsrc/server.tstests/handlers.subscribe.test.tsdenied_channelfixtureaim2be:family:fam-1→family:fam-1The authorization logic is prefix-relative (
startsWith+slice), so own-user allow / foreign / degraded / malformed semantics are unchanged.Verdict
NEEDS_REVIEW.
tsc --noEmitclean; 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, basemain, triggeropenedTL;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:touser:. The explanation in the JSDoc is accurate: Centrifugo namespace names cannot contain:, soaim2be:user:xyzwould resolve to theaim2benamespace (unconfigured) rather than the intendedusernamespace.Verification performed:
USER_CHANNEL_PREFIXin handler, types, server, and test files are consistently updated.aim2be:user:insubscribe.ts(lines 45–46) is intentional — it appears in the docblock as a negative example ("NOTaim2be:user:<uid>").grep aim2be:user:across the repo returns only that one explanatory comment — no stale code references.family:fam-1instead ofaim2be:family:fam-1) correctly exercises thedenied_channelpath under the new prefix.USER_CHANNEL_PREFIXvia 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]