fix: recover CMU Maps embed from in-map navigations #35

Closed
Jc-965 wants to merge 0 commits from cmumaps-embed into main
Jc-965 commented 2026-08-06 22:04:48 +00:00 (Migrated from codeberg.org)

Summary

Signing in from an embedded CMU Maps card could leave the card stuck on an error page. The identity provider does not allow itself to be framed, so the iframe navigated away from the map to a page the card could not display and never recovered.

  • The card now tracks whether a pending load was requested by the card itself. Since assigning src is the only way the card starts a load, a single flag is enough to distinguish its own loads from navigations triggered inside the iframe.
  • If the iframe navigates somewhere the card did not request, the card restores the map instead of leaving the unsupported page visible.
  • The restore cannot loop because only the card assigns src and marks a load as requested.
  • The flag also behaves correctly when React StrictMode runs effects twice, unlike a counter that could become out of sync.

cmuMapsHeader.tsx, cmuMapsLoading.ts, and cmuMapsText.ts only contain comment changes.

## Summary Signing in from an embedded CMU Maps card could leave the card stuck on an error page. The identity provider does not allow itself to be framed, so the iframe navigated away from the map to a page the card could not display and never recovered. - The card now tracks whether a pending load was requested by the card itself. Since assigning `src` is the only way the card starts a load, a single flag is enough to distinguish its own loads from navigations triggered inside the iframe. - If the iframe navigates somewhere the card did not request, the card restores the map instead of leaving the unsupported page visible. - The restore cannot loop because only the card assigns `src` and marks a load as requested. - The flag also behaves correctly when React StrictMode runs effects twice, unlike a counter that could become out of sync. `cmuMapsHeader.tsx`, `cmuMapsLoading.ts`, and `cmuMapsText.ts` only contain comment changes.
Jc-965 closed this pull request 2026-08-13 04:11:52 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.