Clean up IndexedDB previous-page listener#55
Open
issackjohn wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR cleans up the IndexedDB TodoMVC benchmark’s “previous page loaded” synchronization by replacing a shared, hidden promiseResolve function property with a per-transition one-shot promise tied to the previous-page-loaded event. This makes page-transition waiting deterministic (listener installed immediately before the click) and ensures the listener is automatically removed after firing.
Changes:
- Replace the persistent
previous-page-loadedlistener +iterationFinishedListener.promiseResolvestate withwaitForPreviousPageLoaded()that usesaddEventListener(..., { once: true }). - Register the listener immediately before clicking the previous-page button, then
awaitthe resulting promise. - Apply the same update to both the source and generated
distworkload test files.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| experimental/javascript-wc-indexeddb/src/workload-test.mjs | Switches “previous page loaded” waiting logic to a per-iteration one-shot promise to avoid missed events and hidden listener state. |
| experimental/javascript-wc-indexeddb/dist/src/workload-test.mjs | Keeps generated dist workload test in sync with the updated source behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Follow-up for local issue 52.
This replaces the hidden
promiseResolvestate stored oniterationFinishedListenerwith a local one-shotprevious-page-loadedpromise for each page transition.The listener is now registered immediately before clicking the previous-page button, so the event cannot be missed, and it is automatically removed after firing.
Validation:
git diff --checkNote: local Node/npm tooling was not available in this shell, so browser CI should cover the end-to-end validation.