Repository navigation
ping-a-human: a queued Allow / Deny is not sent for a prompt already answered at the desk - #23
Open
connorburgess wants to merge 1 commit into
Conversation
…answered at the desk Asks go one at a time, and each waits up to two minutes for a reply. A permission prompt queued behind another was sent with Allow / Deny when its turn came even if it had been answered at the desk meanwhile, and the queue then waited on a reply to it. The queued step now checks the store first, as the wait before sending already does, and skips a prompt that is no longer open or whose session is gone. Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
This branch has not been deployed
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.
What
@sessionpipe-gui/plugin-ping-a-human: a permission prompt whose Allow / Deny ask is queued behind another one is checked again when its turn comes. If it was answered at the desk in the meantime, or its session is gone, nothing is sent and the queue moves straight on to the next prompt.The check that
fire()already makes after theminSilenceSwait now lives in a smallstillOpen(key, attentionId)helper, and bothfire()and the queued step use it.Why
Asks go out one at a time, because ping-a-human's channel reads a single reply stream, and each one waits up to
REPLY_TIMEOUT_MS(2 minutes) for a tap. Before sending, the queued step only checkedclosed. So when two sessions raised a permission prompt each and the second was answered at the desk while the first was still waiting, the second still went to Telegram with Allow / Deny buttons once the first's wait ended. The queue then waited up to 2 more minutes for a reply to a prompt that was already closed, which delayed any live prompt behind it. The README says a prompt answered at the desk sends nothing, andfire()already keeps that promise for theminSilenceSwait.Not in this PR (each is older than this change and a separate concern):
awaitReplyin ping-a-human's channel, which takes onlytimeoutMsandsinceRef.dryRun,askOnPermission).The CHANGELOG line is left out for now. It would go under a new Fixed heading in Unreleased, and #19 adds that same heading at the same place, so the two would conflict. The line follows once #19 lands: "
@sessionpipe-gui/plugin-ping-a-human: a permission prompt waiting its turn behind another's Allow / Deny is no longer sent once it was answered at the desk."Proof
New test in
packages/plugin-ping-a-human/test/plugin.test.mjs. The fake channel'sawaitReplywaits until the test lets it go. Promptsa,bandd(one per session) fire withminSilenceS: 0, sobanddwait behinda. Thenbis answered at the desk andd's session leaves the store, and only after that doesa's wait end. The test checks that nothing more is sent, that nothing waits on a reply, and that a new promptcis asked at once.With
packages/plugin-ping-a-human/src/index.tsfrommain(d92e06a) and the new test,npm test -w packages/plugin-ping-a-human:On this branch (80fe898),
npm run typecheck && npm run lint && npm run build && npm testat the root:typecheck: canvas, office and ping-a-human pass with no errors.lint:Checked 91 files in 58ms. No fixes applied. Found 2 warnings.Both warnings arenoDescendingSpecificityinpackages/office/src/office.css(801, 844).mainhas those 2 plus a third,useOptionalChainatpackages/plugin-ping-a-human/src/index.ts:225, which this change removes.build: every workspace builds.test:# tests 13,# pass 13,# fail 0.43 failed. Every failure is the same:browserType.launch: Executable doesn't exist at ~/Library/Caches/ms-playwright/chromium_headless_shell-1248/.... This machine has no browser build installed for the pinned Playwright. Unmodifiedmain(d92e06a) fails the same way, with the same 43 tests and the same message, innpm test -w packages/canvas. This PR does not touch canvas.Checklist
git commit -s): the DCO is the only paperwork.npm run typecheck && npm run lint && npm run build && npm testpass, except the canvas Playwright tests: they cannot start a browser on this machine and fail the same way onmain(see above).// SPDX-License-Identifier: Apache-2.0. No new files; nothing bundled.CHANGELOG.mdif a person would notice. It follows once color-themes: check.mjs --skin measures a text tier the skin leaves unset with the stock value, as the GUI does #19 lands (see Why).