Resume joint login after a normal browser startup request - #125
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are scoped, align with existing canonical URL/security header conventions, and are backed by targeted frontend and backend tests covering the new wake-and-resume flow.
Pull request overview
This PR updates the “cold backend after inactivity” login path by switching from an embedded hidden-document warmup attempt to a user-activated top-level navigation that wakes the Render backend, then returns to the canonical WordPress CalorieApp page to resume the existing embedded login flow.
Changes:
- Backend
/healthsupportsresume_login=true, returning a non-cacheable 303 redirect to the fixed WordPress CalorieApp URL while leaving normal health probes as JSON. - The embedded Xaman login control performs a same-tab, user-activated
_topnavigation to the backend health wake URL and uses a short-livedsessionStorageintent to resume login only after a trusted parent handshake. - Removes the prior hidden iframe wake mechanism and replaces its tests with navigation/intent tests.
File summaries
| File | Description |
|---|---|
| tools/tests/backend_warmup_rate_limit.test.mjs | Removes hidden-document warmup test harness paths now that iframe wake is removed. |
| tools/tests/backend_wake_navigation.test.mjs | Adds tests for wake-navigation URL guarding and one-time resume intent behavior through trusted handshake. |
| frontend/lib/backendRequest.ts | Removes the iframe “wake document” mechanism from warmup; keeps readiness probing and rate limiting. |
| frontend/components/XamanLoginPanel.tsx | Adds wake-navigation link, sessionStorage resume intent helpers, and trusted resume trigger on bridge init. |
| backend/tests/test_login_wake_return.py | Adds coverage for fixed redirect destination, no session/cookie creation, and unchanged JSON health probes. |
| backend/app/main.py | Implements /health?resume_login=true 303 redirect to canonical WordPress CalorieApp URL with no-store headers. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
The joint WordPress + CalorieApp login succeeded while the backend was running, but the next attempt after inactivity stalled before any Xaman request. PR #124's hidden document did not resolve this: the user reproduced the startup timeout at 16:21–16:23, and the backend logs show no new startup during that attempt.
The user's direct, top-level visit to the existing backend health URL did wake the service at 15:02–15:03. This change uses that navigation on the main CalorieApp sign-in control and returns automatically to the existing login flow.
Changes:
resume_login=trueflag and issues a non-cacheable 303 to the configured WordPress origin's fixed CalorieApp page once the backend is serving requests. Normal health probes remain JSON.Validation:
Rollout and acceptance:
f689a4acd9bb34f49c6f06267fb22537b17495b0, backend first.dep-daent1f40ujc73814mggbecame live at 2026-09-06 14:55:05 UTC with successful health checks. Frontend deploymentdep-daenu2fqj5pc73a88cvgbecame live at 14:57:10 UTC.GET /health?resume_login=true-> 303 at 17:21:45 CEST, login start -> 200 at 17:21:49, identity callback -> 200 at 17:22:20, and authenticated session/food-log reads -> 200 at 17:22:20 and again after the page update at 17:22:25–26.