{{ message }}
Repository navigation
Make redux.initialize() wait until Redux is ready - #9180
Merged
apple502j merged 2 commits intoSep 26, 2026
Merged
Conversation
mxmou
reviewed
Sep 14, 2026
The promise should exist even while Redux is still loading. If it is missing, throw an error instead of carrying on as though Redux is ready. Also change "Existing callers" to "Callers", since the same advice applies to future addons.
mxmou
approved these changes
Sep 22, 2026
apple502j
approved these changes
Sep 26, 2026
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.

Some userscripts start before Scratch has finished setting up Redux. If they call
addon.tab.redux.initialize()too early, it currently returns straight away and their listener is never connected.This creates the Redux event channel earlier and lets addons wait until the first real Redux state is available:
Addons that only listen for later changes can continue calling it without
await.waitForState()now waits for Redux to be ready before checking the state.The readiness promise exists even while Redux is still loading. If it is missing,
initialize()now throws an error instead of carrying on as though Redux were ready.Fixes #7933