Fix: Show friendly message when invitation link has no id - #363
Draft
posthog-eu[bot] wants to merge 1 commit into
Draft
posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
The invitation accept page threw an error in the render path when the URL had no `id`. The throw reached the top-level ErrorBoundary, which replaced the whole app with a raw error screen. Now the page renders an inline "this invitation link is not valid" state, matching the existing NTFND copy, with a link back to the app. The query is already paused when `id` is missing, so no backend call is needed. Generated-By: PostHog Desktop Task-Id: 660c5e64-310a-4986-8541-cdbccd4a5eda
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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.
Problem
idin the URL sees a full-app crash screen instead of guidance, in the signup and team-joining flow.apps/project/src/pages/invitations/accept.tsxdidthrow new Error("id not supplied")in the render path. Nothing caught it locally, so it reached the top-levelErrorBoundaryinapps/project/src/main.tsx, which swaps the whole app for a rawErrorAlert.NTFND,DNIED,LOGIN). The missing-id case just never got the same treatment.Changes
NTFNDcopy, plus a link back to the app.SharedLayout(navbar + footer), so the page stays intact.pause: !id, so this path makes no backend call.Verification
tsc -bandeslintpass for theprojectapp./invitations/acceptwith no query string in a browser: the page now shows the friendly message and a "Back to the app" button, with no crash.Before: throw → top-level
ErrorBoundary→ whole app replaced byErrorAlert.After: friendly inline state within the normal layout.
Created with PostHog Desktop from this inbox report.