Repository navigation
[Website] Preserve auto-login across browser-stored Playground reopens - #4185
Merged
Merged
Conversation
adamziel
marked this pull request as ready for review
July 29, 2026 08:55
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Ensures reopening or switching back to a previously running auto-login Playground can restore the WordPress admin session without a visible reload unless needed, addressing the “can’t get back into wp-admin” scenario in #4092.
Changes:
- Adds a Redux listener that probes the force-login mu-plugin path when an already-running auto-login site becomes active again.
- Refreshes the retained iframe only when the probe indicates a login occurred (302).
- Enables the mu-plugin force-login recovery path at boot for auto-login sites via a defined constant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/redux/site-management-api-middleware.ts | Adds active-site-change listener to re-establish session via background request and conditional refresh. |
| packages/playground/website/src/lib/state/redux/boot-site-client.ts | Injects PLAYGROUND_FORCE_AUTO_LOGIN_ENABLED constant for auto-login Playgrounds to activate mu-plugin recovery path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The first OPFS copy stored WordPress files but dropped constants defined by live Blueprint steps. Persist them in the same metadata write that marks the copy complete so later runtimes can replay them.
adamziel
force-pushed
the
adamziel/relogin-on-site-reopen
branch
from
July 29, 2026 13:10
549531c to
1e3186e
Compare
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.
Browser-stored Playgrounds now preserve auto-login after they are reopened.
Before this PR, the first MEMFS-to-OPFS copy stored WordPress files but not constants registered by live Blueprint steps. Reopening the Playground created a new runtime without
PLAYGROUND_AUTO_LOGIN_AS_USER, so/wp-admin/showed the login screen.After this PR, that initial copy persists live PHP constants in the same metadata write that marks the copy complete, and later runtimes replay them. A failed constants read leaves the copy pending instead of silently saving incomplete state. Older completed saves cannot be backfilled because their retired runtime was the only authoritative source.
Test plan
Wait for browser autosave, switch to another Playground and back, then confirm
/wp-admin/opens logged in.