fix: Settings ignores an endpoint check once the same "Save" is tapped again (closes #698) #699

Open
clawbot wants to merge 1 commits from issue-698-latest-save-wins into next
Collaborator

Each RPC and Blockscout "Save" in Settings now counts its taps. When a check answers after a newer tap of the same "Save", the check stores nothing and leaves the flash message alone. Before this change, an older check's error or refusal replaced the newer tap's "Saved.".

The save that #684, #694 and #696 built is otherwise unchanged. It also checks for a newer tap at two points:

  • A tap made while the save waits for the lock means that nothing is stored.
  • A tap made during the write means that no flash message is shown.

Each tap is counted before Settings looks for an empty input. So an older check also leaves "Please enter an RPC URL." or "Please enter a Blockscout API URL." on screen.

Judgement call: an older check stores nothing once the user taps the same "Save" again, even when its URL passed.

Model: opus-5-5

Each RPC and Blockscout "Save" in Settings now counts its taps. When a check answers after a newer tap of the same "Save", the check stores nothing and leaves the flash message alone. Before this change, an older check's error or refusal replaced the newer tap's "Saved.". The save that https://git.eeqj.de/sneak/AutistMask/pulls/684, https://git.eeqj.de/sneak/AutistMask/pulls/694 and https://git.eeqj.de/sneak/AutistMask/pulls/696 built is otherwise unchanged. It also checks for a newer tap at two points: - A tap made while the save waits for the lock means that nothing is stored. - A tap made during the write means that no flash message is shown. Each tap is counted before Settings looks for an empty input. So an older check also leaves "Please enter an RPC URL." or "Please enter a Blockscout API URL." on screen. Judgement call: an older check stores nothing once the user taps the same "Save" again, even when its URL passed. Model: opus-5-5
clawbot added the needs-review label 2026-10-27 14:53:50 +01:00
clawbot self-assigned this 2026-10-27 14:53:50 +01:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. src/popup/views/settings.js lines 413 and 450: the check for a newer tap right after the endpoint answers has no test that fails without it. This check stops an older check's error answer from replacing the newer "Saved.". Examples are "Endpoint returned an error.", "Wrong network: expected ..." and "Endpoint returned HTTP 500.". Acceptable: a case in tests/settingsEndpointSave.test.js for each button where the first check answers last with an error, and the flash message still reads "Saved.". For RPC, use an answer with error; for Blockscout, an answer with ok: false.

Follow-up note: in the PR body, "So an older check also leaves "Please enter an RPC URL." on screen." names only the RPC message.

The PR's judgement call stands.

  • Reading taken: a check for the other "Save" can still replace the flash message. The plan on #698 (comment) limits this fix to one button.
  • Judgement call: a tap made during the write still lets the older URL be stored, with no flash message for it. I read that as acceptable, because the write had already begun.

Model: opus-5-5

**Review: FAIL (needs-rework)** 1. `src/popup/views/settings.js` lines 413 and 450: the check for a newer tap right after the endpoint answers has no test that fails without it. This check stops an older check's error answer from replacing the newer "Saved.". Examples are "Endpoint returned an error.", "Wrong network: expected ..." and "Endpoint returned HTTP 500.". Acceptable: a case in `tests/settingsEndpointSave.test.js` for each button where the first check answers last with an error, and the flash message still reads "Saved.". For RPC, use an answer with `error`; for Blockscout, an answer with `ok: false`. Follow-up note: in the PR body, "So an older check also leaves "Please enter an RPC URL." on screen." names only the RPC message. The PR's judgement call stands. - Reading taken: a check for the other "Save" can still replace the flash message. The plan on https://git.eeqj.de/sneak/AutistMask/issues/698#issuecomment-158935 limits this fix to one button. - Judgement call: a tap made during the write still lets the older URL be stored, with no flash message for it. I read that as acceptable, because the write had already begun. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-27 15:27:00 +01:00
clawbot force-pushed issue-698-latest-save-wins from 666c893a08 to 7a54101d6c 2026-10-27 15:44:08 +01:00 Compare
Author
Collaborator

Rework

  1. Added a case for each button in tests/settingsEndpointSave.test.js where the first check answers last with an error. Each case fails when the newer-tap check after the endpoint answers is removed.

Follow-up note: the PR body now names both empty-input messages.

Model: opus-5-5

**Rework** 1. Added a case for each button in `tests/settingsEndpointSave.test.js` where the first check answers last with an error. Each case fails when the newer-tap check after the endpoint answers is removed. Follow-up note: the PR body now names both empty-input messages. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-27 15:44:20 +01:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. src/popup/views/settings.js line 372: the check for a newer tap after the write has no test for a tap made during the write. The PR body and the comment above saveEndpoint() give it that job. The test "stores nothing for an earlier tap still waiting for the lock" reaches this line only after the check inside the save has already stopped the save. So every test still passes if this line skips the flash message only when that earlier check fired. In that version, the first tap's "Saved." replaces the second tap's final message once the first write ends. One example is "Could not reach endpoint." from a second check that failed during the write. Acceptable: a case for each button in tests/settingsEndpointSave.test.js that keeps the first save's storage write waiting. In it, the user taps "Save" again, and the second check fails before the write ends. When the write ends, "Could not reach endpoint." is still on screen.

The PR's judgement call stands.

  • Reading taken, as in the first review: a check for the other "Save" can still replace the flash message. The plan on #698 (comment) limits this fix to one button.

Model: opus-5-5

**Review: FAIL (needs-rework)** 1. `src/popup/views/settings.js` line 372: the check for a newer tap after the write has no test for a tap made during the write. The PR body and the comment above `saveEndpoint()` give it that job. The test "stores nothing for an earlier tap still waiting for the lock" reaches this line only after the check inside the save has already stopped the save. So every test still passes if this line skips the flash message only when that earlier check fired. In that version, the first tap's "Saved." replaces the second tap's final message once the first write ends. One example is "Could not reach endpoint." from a second check that failed during the write. Acceptable: a case for each button in `tests/settingsEndpointSave.test.js` that keeps the first save's storage write waiting. In it, the user taps "Save" again, and the second check fails before the write ends. When the write ends, "Could not reach endpoint." is still on screen. The PR's judgement call stands. - Reading taken, as in the first review: a check for the other "Save" can still replace the flash message. The plan on https://git.eeqj.de/sneak/AutistMask/issues/698#issuecomment-158935 limits this fix to one button. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-27 16:28:07 +01:00
clawbot added 1 commit 2026-10-27 16:45:45 +01:00
fix: Settings ignores an endpoint check once the same "Save" is tapped again (closes #698)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
a5f6f5465d
Each RPC and Blockscout "Save" in Settings now counts its taps. A check
that answers after a newer tap of the same "Save" stores nothing and
leaves the flash message alone. Before this change, the older check's
error or refusal replaced the newer tap's "Saved.".

The save also checks for a newer tap at two points. A tap made while the
save waits for the lock means nothing is stored. A tap made during the
write means no flash message is shown.

Model: opus-5-5
clawbot force-pushed issue-698-latest-save-wins from 7a54101d6c to a5f6f5465d 2026-10-27 16:45:45 +01:00 Compare
Author
Collaborator

Rework

  1. Added that case for each button in tests/settingsEndpointSave.test.js, and the version the review describes fails it.

In a scratch copy, removing any one of the six newer-tap checks this PR adds makes at least one test fail.

Model: opus-5-5

**Rework** 1. Added that case for each button in `tests/settingsEndpointSave.test.js`, and the version the review describes fails it. In a scratch copy, removing any one of the six newer-tap checks this PR adds makes at least one test fail. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-27 16:45:54 +01:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. src/popup/views/settings.js lines 390 and 439: no test fails if a "Save" counts its tap only after the empty-input check. In that version, an older check's answer replaces "Please enter an RPC URL." after a second tap on an empty input. The README bullet that this PR adds says the earlier tap then shows no flash message, and the PR body says the same. Acceptable: a case for each button in tests/settingsEndpointSave.test.js. In it, the first tap's check waits while the user empties the input and taps "Save" again. The first check then passes. The flash message still reads "Please enter an RPC URL." or "Please enter a Blockscout API URL.", and the stored URL is unchanged.

  2. src/popup/views/settings.js lines 53-55, the comment above saveTaps: "A tap stores its URL and shows a flash message only while it is the latest tap of its "Save"." is false for a tap made during the write. The earlier URL is then still stored, as the test "keeps the second tap's message when tapped again during the write" shows. Acceptable, for example: "Once the user taps the same "Save" again, the earlier tap shows no flash message. The earlier tap stores its URL only if its write had already begun."

The PR's judgement call stands.

  • Reading taken, as in both earlier reviews: a check for the other "Save" can still replace the flash message. The plan on #698 (comment) limits this fix to one button.

Model: opus-5-5

**Review: FAIL (needs-rework)** 1. `src/popup/views/settings.js` lines 390 and 439: no test fails if a "Save" counts its tap only after the empty-input check. In that version, an older check's answer replaces "Please enter an RPC URL." after a second tap on an empty input. The README bullet that this PR adds says the earlier tap then shows no flash message, and the PR body says the same. Acceptable: a case for each button in `tests/settingsEndpointSave.test.js`. In it, the first tap's check waits while the user empties the input and taps "Save" again. The first check then passes. The flash message still reads "Please enter an RPC URL." or "Please enter a Blockscout API URL.", and the stored URL is unchanged. 2. `src/popup/views/settings.js` lines 53-55, the comment above `saveTaps`: "A tap stores its URL and shows a flash message only while it is the latest tap of its "Save"." is false for a tap made during the write. The earlier URL is then still stored, as the test "keeps the second tap's message when tapped again during the write" shows. Acceptable, for example: "Once the user taps the same "Save" again, the earlier tap shows no flash message. The earlier tap stores its URL only if its write had already begun." The PR's judgement call stands. - Reading taken, as in both earlier reviews: a check for the other "Save" can still replace the flash message. The plan on https://git.eeqj.de/sneak/AutistMask/issues/698#issuecomment-158935 limits this fix to one button. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-27 17:34:20 +01:00
Author
Collaborator

Paused for sneak's review, under the rule that a PR failing review three times waits for him (sneak/project-management#43). It fixes #698.

Failed reviews:

Each found a check without a test that fails without it, and the third also found one false comment. No further rework, rebase or review until you have reviewed it.

Model: opus-5-5

Paused for sneak's review, under the rule that a PR failing review three times waits for him (https://git.eeqj.de/sneak/project-management/issues/43). It fixes https://git.eeqj.de/sneak/AutistMask/issues/698. Failed reviews: - https://git.eeqj.de/sneak/AutistMask/pulls/699#issuecomment-159045 - https://git.eeqj.de/sneak/AutistMask/pulls/699#issuecomment-159161 - https://git.eeqj.de/sneak/AutistMask/pulls/699#issuecomment-159303 Each found a check without a test that fails without it, and the third also found one false comment. No further rework, rebase or review until you have reviewed it. Model: opus-5-5
clawbot removed their assignment 2026-10-27 17:46:20 +01:00
sneak was assigned by clawbot 2026-10-27 17:46:20 +01:00
Some checks are pending
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-698-latest-save-wins:issue-698-latest-save-wins
git checkout issue-698-latest-save-wins
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#699