Skip to content

Prevent Xaman launch tab from getting stuck - #13

Merged
xrpbanks merged 1 commit into
mainfrom
fix-xaman-launch-429
Aug 29, 2026
Merged

Prevent Xaman launch tab from getting stuck#13
xrpbanks merged 1 commit into
mainfrom
fix-xaman-launch-429

Conversation

@xrpbanks

Copy link
Copy Markdown
Contributor

Summary

  • retry transient Render 429/502/503/504 responses before starting Xaman
  • let the temporary launch tab securely navigate itself through a same-origin, attempt-bound message
  • prevent the launch tab from remaining indefinitely on Preparing when startup fails
  • clearly warn phone users everywhere CalorieApp refers to Xaman sign-in that the return normally opens in the configured default browser, possibly in a new tab

Verification

  • frontend lint passed
  • frontend production build passed
  • branch diff verified: exactly 6 intended frontend/documentation files
  • no backend, WordPress plugin, or release-check.ps1 changes

Do not merge until all GitHub checks are green.

Copilot AI lite review requested due to automatic review settings August 29, 2026 03:28
@xrpbanks
xrpbanks merged commit b3943a3 into main Aug 29, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the Xaman sign-in launch flow so the temporary launch tab can reliably transition from “Preparing” to the actual Xaman/WordPress sign-in, while also improving user-facing guidance (especially on phones) about the expected browser/tab behavior during the return.

Changes:

  • Add retry/backoff logic for starting the login when the backend returns transient 429/502/503/504 responses.
  • Switch the launch tab navigation to a same-origin, attempt-bound postMessage handshake (instead of directly assigning the external URL from the opener tab).
  • Add/standardize “phone browser notice” messaging across Xaman-related login surfaces and docs, and add launch-tab status messaging to avoid indefinite “Preparing” UI.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Updates documentation to require phone-user warnings on all Xaman login surfaces.
frontend/components/XamanLoginPanel.tsx Adds start-login retry logic and attempt-bound message-based navigation for the launch tab; updates UX copy and adds a phone notice callout.
frontend/components/FoodSearchPlaceholder.tsx Adds phone browser notice near Xaman sign-in CTA messaging.
frontend/app/auth/launching/page.tsx Implements the launch/holding page listener that waits for an attempt-bound message and navigates securely; adds live status messaging.
frontend/app/auth/complete/page.tsx Adds phone browser notice content to clarify why the return page may open elsewhere.
frontend/app/auth/callback/page.tsx Adds phone browser notice content and adjusts spacing to accommodate the new warning block(s).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}, [refreshCurrentUser]);

async function handleLogin() {
const attemptId = window.crypto.randomUUID();
Comment on lines +32 to +36
useEffect(() => {
const attemptId = new URLSearchParams(window.location.search).get(
"attempt"
);

Comment on lines +34 to +37
const LOGIN_START_RETRY_WINDOW_MS = 2 * 60_000;
const LOGIN_START_RETRY_DELAY_MS = 15_000;
const XAMAN_LAUNCH_MESSAGE_TYPE = "calorieapp-xaman-navigate";
const XAMAN_LAUNCH_ERROR_TYPE = "calorieapp-xaman-error";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants