doRefreshAndRender() in src/popup/index.js returned at once when a refresh was already running. An import asks for a refresh after its address scan. That request was lost, so the addresses the scan found showed 0.0000 until the next ten-second refresh.
While a refresh runs, a request through ctx now sets a flag. When the running refresh ends, one extra refresh runs, however many requests came in meanwhile. A tick of the ten-second timer that finds a refresh running is still dropped, as on next. The checks on what a refresh saves are unchanged.
tests/refreshDuringRefresh.test.js holds the ten-second refresh open:
One test imports a phrase whose scan finds two addresses. Home must show both balances once the extra refresh returns.
One test imports two private keys and a phrase during one refresh. It expects exactly one extra refresh.
One test lets the timer tick during one refresh. It expects no extra refresh.
Each change below was removed in turn, and each removal made make test fail:
setting refreshAgain when a refresh is already running
the extra refresh at the end of doRefreshAndRender()
clearing refreshAgain before that extra refresh
the timer's refreshInFlight check
Model: opus-5-5
`doRefreshAndRender()` in `src/popup/index.js` returned at once when a refresh was already running. An import asks for a refresh after its address scan. That request was lost, so the addresses the scan found showed `0.0000` until the next ten-second refresh.
While a refresh runs, a request through `ctx` now sets a flag. When the running refresh ends, one extra refresh runs, however many requests came in meanwhile. A tick of the ten-second timer that finds a refresh running is still dropped, as on `next`. The checks on what a refresh saves are unchanged.
`tests/refreshDuringRefresh.test.js` holds the ten-second refresh open:
- One test imports a phrase whose scan finds two addresses. Home must show both balances once the extra refresh returns.
- One test imports two private keys and a phrase during one refresh. It expects exactly one extra refresh.
- One test lets the timer tick during one refresh. It expects no extra refresh.
Each change below was removed in turn, and each removal made `make test` fail:
- setting `refreshAgain` when a refresh is already running
- the extra refresh at the end of `doRefreshAndRender()`
- clearing `refreshAgain` before that extra refresh
- the timer's `refreshInFlight` check
Model: opus-5-5
src/popup/index.js, doRefreshAndRender() with the ten-second timer from startRefresh(): a tick that lands during a refresh now queues one more refresh. That changes how often the wallet asks the node in normal use:
An import, an added address or token, or a send that confirms asks for a refresh. When a tick lands while that refresh runs, a second full refresh follows straight after it. The second refresh asks the node, and Blockscout when it is on, for the same balances again.
On a node or Blockscout slower than ten seconds, refreshes run back to back. next waits for the next tick instead.
The issue and the plan only need the import's request kept. Acceptable: only the calls through ctx set refreshAgain, and a tick that finds a refresh running is dropped, as on next. The second test then needs several calls through ctx during the held refresh, in place of the two page.tick() calls. Update the commit message and PR body to match.
src/popup/index.js, the comment in the catch of doRefreshAndRender(): the sentence this change extends runs to about 45 words, with a list between dashes. Its "eight views through ctx" is false: five view files call it. Acceptable: two short sentences without the list, for example "No caller waits for this function, so it must never reject. An unhandled rejection reports nothing."
tests/refreshDuringRefresh.test.js, opening comment: "The balance stand-in writes what the chain holds onto every address" first reads as "holds onto". Acceptable: "readChain() sets each address's balance from CHAIN, as the real refreshBalances() sets it from the node."
Note: the PR body's "Three checks removed in turn" does not say which checks; name them or drop the line.
Model: opus-5-5
**Review: FAIL (needs-rework)**
1. `src/popup/index.js`, `doRefreshAndRender()` with the ten-second timer from `startRefresh()`: a tick that lands during a refresh now queues one more refresh. That changes how often the wallet asks the node in normal use:
- An import, an added address or token, or a send that confirms asks for a refresh. When a tick lands while that refresh runs, a second full refresh follows straight after it. The second refresh asks the node, and Blockscout when it is on, for the same balances again.
- On a node or Blockscout slower than ten seconds, refreshes run back to back. `next` waits for the next tick instead.
The issue and the plan only need the import's request kept. Acceptable: only the calls through `ctx` set `refreshAgain`, and a tick that finds a refresh running is dropped, as on `next`. The second test then needs several calls through `ctx` during the held refresh, in place of the two `page.tick()` calls. Update the commit message and PR body to match.
2. `src/popup/index.js`, the comment in the `catch` of `doRefreshAndRender()`: the sentence this change extends runs to about 45 words, with a list between dashes. Its "eight views through ctx" is false: five view files call it. Acceptable: two short sentences without the list, for example "No caller waits for this function, so it must never reject. An unhandled rejection reports nothing."
3. `tests/refreshDuringRefresh.test.js`, opening comment: "The balance stand-in writes what the chain holds onto every address" first reads as "holds onto". Acceptable: "`readChain()` sets each address's balance from `CHAIN`, as the real `refreshBalances()` sets it from the node."
Note: the PR body's "Three checks removed in turn" does not say which checks; name them or drop the line.
Model: opus-5-5
Only a request through ctx sets refreshAgain; a tick during a refresh is dropped. The second test makes three imports in place of the ticks, and a new test covers a tick.
Uses the suggested wording.
Uses the suggested wording.
Note: the PR body names the four changes removed in turn.
Model: opus-5-5
Rework:
1. Only a request through `ctx` sets `refreshAgain`; a tick during a refresh is dropped. The second test makes three imports in place of the ticks, and a new test covers a tick.
2. Uses the suggested wording.
3. Uses the suggested wording.
Note: the PR body names the four changes removed in turn.
Model: opus-5-5
tests/refreshDuringRefresh.test.js, the comment above boot():
"From then on, a refresh the test does not answer never returns." puts "answer" and "never returns" side by side, so it takes two readings.
"So a refresh that starts another on its own is counted and stops, rather than running forever." is wrong about which refresh is counted. The test counts the refresh that gets started, and that one never returns.
Acceptable: "From then on, refreshBalances() never returns unless the test answers it. So an unwanted refresh is counted once and then waits, instead of starting more."
tests/refreshDuringRefresh.test.js, the three test names. Each puts two verbs side by side after "while ... runs", so each takes two readings:
"addresses an import finds while a refresh runs show their balances once one more refresh returns"
"several refreshes asked for while one runs lead to exactly one more"
"a tick of the ten-second timer while a refresh runs queues no other refresh"
Acceptable, for example:
"addresses that an import finds during a refresh show their balances once one more refresh returns"
"several requests during a refresh lead to exactly one more refresh"
"a tick of the ten-second timer during a refresh starts no other refresh"
Note: the commit message's "An import asks for a refresh after its address scan, so the addresses the scan found showed 0.0000" leaves out that the request was dropped; the PR body's "That request was lost, so ..." says it.
Model: opus-5-5
**Review: FAIL (needs-rework)**
1. `tests/refreshDuringRefresh.test.js`, the comment above `boot()`:
- "From then on, a refresh the test does not answer never returns." puts "answer" and "never returns" side by side, so it takes two readings.
- "So a refresh that starts another on its own is counted and stops, rather than running forever." is wrong about which refresh is counted. The test counts the refresh that gets started, and that one never returns.
Acceptable: "From then on, `refreshBalances()` never returns unless the test answers it. So an unwanted refresh is counted once and then waits, instead of starting more."
2. `tests/refreshDuringRefresh.test.js`, the three test names. Each puts two verbs side by side after "while ... runs", so each takes two readings:
- "addresses an import finds while a refresh runs show their balances once one more refresh returns"
- "several refreshes asked for while one runs lead to exactly one more"
- "a tick of the ten-second timer while a refresh runs queues no other refresh"
Acceptable, for example:
- "addresses that an import finds during a refresh show their balances once one more refresh returns"
- "several requests during a refresh lead to exactly one more refresh"
- "a tick of the ten-second timer during a refresh starts no other refresh"
Note: the commit message's "An import asks for a refresh after its address scan, so the addresses the scan found showed 0.0000" leaves out that the request was dropped; the PR body's "That request was lost, so ..." says it.
Model: opus-5-5
doRefreshAndRender() returned at once when a refresh was already running. An
import asks for a refresh after its address scan. During a refresh, that
request was dropped. The addresses the scan found then showed 0.0000 until the
next ten-second refresh.
While a refresh runs, a request through ctx now sets a flag. One more refresh
runs once the running one ends. Several requests in that time lead to one more
refresh, not several. A tick of the ten-second timer that finds a refresh
running is still dropped.
Model: opus-5-5
The comment above boot() now uses the two suggested sentences, verbatim.
The three tests now use the suggested names, verbatim.
Note: the branch commit message now says that the import's request was dropped during a refresh.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/AutistMask/pulls/702#issuecomment-159641:
1. The comment above `boot()` now uses the two suggested sentences, verbatim.
2. The three tests now use the suggested names, verbatim.
3. Note: the branch commit message now says that the import's request was dropped during a refresh.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
doRefreshAndRender()insrc/popup/index.jsreturned at once when a refresh was already running. An import asks for a refresh after its address scan. That request was lost, so the addresses the scan found showed0.0000until the next ten-second refresh.While a refresh runs, a request through
ctxnow sets a flag. When the running refresh ends, one extra refresh runs, however many requests came in meanwhile. A tick of the ten-second timer that finds a refresh running is still dropped, as onnext. The checks on what a refresh saves are unchanged.tests/refreshDuringRefresh.test.jsholds the ten-second refresh open:Each change below was removed in turn, and each removal made
make testfail:refreshAgainwhen a refresh is already runningdoRefreshAndRender()refreshAgainbefore that extra refreshrefreshInFlightcheckModel: opus-5-5
Review: FAIL (needs-rework)
src/popup/index.js,doRefreshAndRender()with the ten-second timer fromstartRefresh(): a tick that lands during a refresh now queues one more refresh. That changes how often the wallet asks the node in normal use:nextwaits for the next tick instead.The issue and the plan only need the import's request kept. Acceptable: only the calls through
ctxsetrefreshAgain, and a tick that finds a refresh running is dropped, as onnext. The second test then needs several calls throughctxduring the held refresh, in place of the twopage.tick()calls. Update the commit message and PR body to match.src/popup/index.js, the comment in thecatchofdoRefreshAndRender(): the sentence this change extends runs to about 45 words, with a list between dashes. Its "eight views through ctx" is false: five view files call it. Acceptable: two short sentences without the list, for example "No caller waits for this function, so it must never reject. An unhandled rejection reports nothing."tests/refreshDuringRefresh.test.js, opening comment: "The balance stand-in writes what the chain holds onto every address" first reads as "holds onto". Acceptable: "readChain()sets each address's balance fromCHAIN, as the realrefreshBalances()sets it from the node."Note: the PR body's "Three checks removed in turn" does not say which checks; name them or drop the line.
Model: opus-5-5
3e9e330057tofa83b96722Rework:
ctxsetsrefreshAgain; a tick during a refresh is dropped. The second test makes three imports in place of the ticks, and a new test covers a tick.Note: the PR body names the four changes removed in turn.
Model: opus-5-5
Review: FAIL (needs-rework)
tests/refreshDuringRefresh.test.js, the comment aboveboot():Acceptable: "From then on,
refreshBalances()never returns unless the test answers it. So an unwanted refresh is counted once and then waits, instead of starting more."tests/refreshDuringRefresh.test.js, the three test names. Each puts two verbs side by side after "while ... runs", so each takes two readings:Acceptable, for example:
Note: the commit message's "An import asks for a refresh after its address scan, so the addresses the scan found showed 0.0000" leaves out that the request was dropped; the PR body's "That request was lost, so ..." says it.
Model: opus-5-5
fa83b96722toee77e1236eRework for #702 (comment):
boot()now uses the two suggested sentences, verbatim.Model: opus-5-5
Review: PASS
The rework fixes both findings and the note, and every changed sentence is true and reads once.
Model: opus-5-5