fix(session): fetch the live gate when a permission answer is rejected - #1033
Merged
Conversation
The client took a permission card down on gate_mismatch and unknown_option, but the streamer only clears its input gate on gate_closed. Both codes left the gate open with nothing on screen to answer, so /input kept refusing text. Only gate_closed now clears and suppresses the card; the other two drop the stale card unsuppressed and resubscribe, so the streamer unicasts the live gate back as a fresh, answerable card. The no-retry decision is unchanged and now has its own name, so the two decisions cannot be confused. This covers the legacy /permission/answer route used by streamers that predate the prompt contract. Refs #954
RonenMars
force-pushed
the
fix/permission-gate-closed-codes
branch
from
September 10, 2026 15:30
d0f7c12 to
c651a6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The client took a permission card down on
gate_mismatchandunknown_option, but the streamer only clears its input gate ongate_closed.Both codes left the gate open with nothing on screen to answer, so
/inputkept refusing text.Only
gate_closednow clears and suppresses the card.The other two drop the stale card without suppression and re-send
subscribe_session, so the streamer unicasts the live gate back as a fresh, answerable card.The no-retry decision is unchanged and now has its own name,
isPermissionAnswerRejectedError, separate from the teardown checkisPermissionGateClosedError.Scope
This covers the legacy
/permission/answerroute, which the app only uses against streamers that predate the prompt contract.The lockout reported in #954 went through
/prompt/answer, and its fix is on the streamer side: RonenMars/threadbase-streamer#849 clears the stale entry, and RonenMars/threadbase-streamer#850 fixes the answer check that left it behind.This PR therefore references #954 rather than closing it.
Tests
gate_mismatch, the card drops,subscribe_sessionis sent, and a replayed gate with a newgateIdlands active and answerable.unknown_option, the replayed same gate is shown again, which is the caseclear()would have swallowed.gate_closed, the card clears, nothing is resubscribed, and repaints stay suppressed.clear()in place ofresetAndUnsuppress(), 3 fail.Refs #954