fix: unblock hung Log Out and Mingo archive TypeError - #292
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Two confirmation modals never settled. Log Out: `logoutAsync` fired a `fetch` with no timeout, and `performLogout` awaited it before it cleared local state or redirected. A hung request never rejected, so the modal spinner stayed forever and the session stayed live. Bound the call with an AbortController timeout so sign-out always proceeds. Mingo dialog helper: `runDialogMutation` and the archived-list fetch read `response.data.data[key]` without checking the GraphQL `errors` array or a null `data`. A failed mutation returns HTTP 200 with `data: null`, so the code threw a raw TypeError. Check `errors` first and guard `data` before indexing it. Generated-By: PostHog Desktop Task-Id: 11ac13fe-6342-49cb-8ee3-48119bbee96e
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
TypeErrorbanner instead of the archive./dashboard, still authenticated.Cannot read properties of null (reading 'archiveDialog')instead of the server's reason.Root cause
logoutAsyncfiredfetchwith no timeout and noAbortController;performLogoutawaited it before clearing local state or redirecting. A hung request never rejects, so thecatchnever runs andisPendingstaystrueforever.runDialogMutationand the archived-list fetch readresponse.data.data[key]without checking the GraphQLerrorsarray or a nulldata. A failed mutation returns HTTP 200 withdata: null, so the code dereferences null.Changes
AbortControlleraborts thefetchafter 5 s. On timeout the fetch rejects,logoutAsyncreturnsfalse, andperformLogoutruns its existing teardown and redirect regardless of the server result.response.data.errorsfirst and surface the server's message, then guarddatabefore indexing it — matching the existing pattern intickets/utils/graphql.tsandmingo/context/rest-items.tsx.Verification
npm run type-checkandnpm run lint:biomepass on both changed files.Created with PostHog Desktop from this inbox report.