Repository navigation
fix(relay): make fenceAndCloseNow stop the liveness safety net - #12482
Conversation
The 5-minute liveness tick from #12432 survived fenceAndCloseNow(), so a tick landing between the pre-sign-out fence and the profile wipe could briefly resurrect a broker (benign but soft — the entitlement check bails afterward). The fence now clears the interval; the next auth mutation re-arms it via refreshDemand, and the safety net otherwise behaves identically. Found in release review of the #12432 cherry-pick.
📝 WalkthroughWalkthroughThe desktop relay service now initializes liveness monitoring from 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/runtime/relay/desktop-relay-service.test.ts (1)
80-83: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the pending-demand expiry path.
Line 80 returns
null, so this test cannot detect ademandExpiryTimerfiring afterfenceAndCloseNow(). Add a case with a near-future expiry and assert thatensureLive()remains unchanged untilauthMutated().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ddc2e9e-ff52-4e45-9497-eec21a616f06
📒 Files selected for processing (2)
src/main/runtime/relay/desktop-relay-service.test.tssrc/main/runtime/relay/desktop-relay-service.ts
The 5-minute liveness tick from #12432 survived fenceAndCloseNow(), so a tick landing between the pre-sign-out fence and the profile wipe could briefly resurrect a broker (benign but soft — the entitlement check bails afterward). The fence now clears the interval; the next auth mutation re-arms it via refreshDemand, and the safety net otherwise behaves identically. Found in release review of the #12432 cherry-pick. Co-authored-by: OrcaWin <[email protected]>
…yai#12482) The 5-minute liveness tick from stablyai#12432 survived fenceAndCloseNow(), so a tick landing between the pre-sign-out fence and the profile wipe could briefly resurrect a broker (benign but soft — the entitlement check bails afterward). The fence now clears the interval; the next auth mutation re-arms it via refreshDemand, and the safety net otherwise behaves identically. Found in release review of the stablyai#12432 cherry-pick. Co-authored-by: OrcaWin <[email protected]>
Follow-up to #12432, found during release review of its cherry-pick onto v1.4.168-rc.3 (credit: the release agent).
fenceAndCloseNow()didn't clear the 5-minute liveness interval — onlystop()did — so after a sign-out fence the safety net kept ticking. Mostly benign (each tick's reconcile re-reads the auth context and bails on!context || !relayEntitled), but a tick landing in the window between the pre-sign-out fence and the profile wipe could briefly resurrect a broker, making the fence soft instead of hard.Fix: the fence clears the interval;
refreshDemand()(start, auth mutation, demand change) re-arms it, so a subsequent sign-in restores the safety net.stop()behavior unchanged.Test: red-before/green-after lifecycle test — tick fires while started, goes silent after fence (30 simulated minutes), resumes after
authMutated(), silent afterstop(). Verified failing against the pre-fix service.Not needed for the v1.4.168 promotion — this hardens
main; the RC cherry-pick of #12432 stands as reviewed.