Skip to content

Fix state legislative tracker sharing links returning 404#911

Closed
DTrim99 wants to merge 1 commit intomainfrom
fix/tracker-sharing-links
Closed

Fix state legislative tracker sharing links returning 404#911
DTrim99 wants to merge 1 commit intomainfrom
fix/tracker-sharing-links

Conversation

@DTrim99
Copy link
Copy Markdown
Contributor

@DTrim99 DTrim99 commented Apr 3, 2026

Summary

  • Previously, only crawler/bot requests were proxied to Modal for state legislative tracker routes
  • Regular user requests fell through and returned 404 because the app shell doesn't handle those routes
  • Now ALL requests to /us/state-legislative-tracker/* are proxied to Modal, allowing direct sharing links

Before

https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450 → 404 Page Not Found

After

https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450 → Works correctly

Test plan

  • Verify https://www.policyengine.org/us/state-legislative-tracker loads correctly
  • Verify https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450 loads correctly
  • Verify social media previews still work (crawler functionality preserved)

🤖 Generated with Claude Code

Previously, only crawler/bot requests were proxied to Modal for the
state legislative tracker routes. Regular user requests fell through
and returned 404 because the app shell doesn't handle those routes.

Now ALL requests to /us/state-legislative-tracker/* are proxied to Modal,
allowing direct sharing links like:
https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450

Also preserves query strings in the proxy URL.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Apr 3, 2026 7:27pm
policyengine-calculator Ready Ready Preview, Comment Apr 3, 2026 7:27pm
policyengine-calculator-next Error Error Apr 3, 2026 7:27pm
policyengine-website Ready Ready Preview, Comment Apr 3, 2026 7:27pm

Request Review

SakshiKekre added a commit that referenced this pull request Apr 3, 2026
Add beforeFiles rewrites so tracker deep links like
/us/state-legislative-tracker/MN/mn-hf4621 are served directly from
Modal instead of through an iframe. The tracker's client-side router
handles the path on page load.

Previously, only /_tracker/* asset paths were rewritten. The tracker
page itself was served via iframe through the [slug] route, which only
matches a single path segment — deep links with state/bill sub-paths
returned 404.

Fixes #911
SakshiKekre added a commit that referenced this pull request Apr 6, 2026
Deep links like /us/state-legislative-tracker/MN/mn-hf4621 have been
returning 404 because the iframe approach creates URLs the server
can't resolve. The rewrite serves the tracker SPA directly from Modal
so its client-side router handles any path natively.

Known issues (to be fixed in a follow-up PR to the tracker repo):
- Tracker has no PE header/footer (was provided by the iframe wrapper)
- Favicon and logo SVGs use root-relative paths that 404 on our domain

Fixes #911
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.

1 participant