Title: fix(invite): hold the loading state until the stored token resolves by waleedlatif1 · Pull Request #6488 · simstudioai/sim · GitHub
Open Graph Title: fix(invite): hold the loading state until the stored token resolves by waleedlatif1 · Pull Request #6488 · simstudioai/sim
X Title: fix(invite): hold the loading state until the stored token resolves by waleedlatif1 · Pull Request #6488 · simstudioai/sim
Description: Summary Closes two gaps left by #6486, both in apps/sim/app/invite/[id]/invite.tsx. Loading state didn't follow the query gate. #6486 gated the invitation query on isTokenResolved but left isLoading reading only invitationQuery.isPending. With enabled: false React Query still reports success when the key already holds data, so a cached null-token entry makes isPending false — the accept UI renders for one frame before the effect applies the stored token. Now !isTokenResolved || invitationQuery.isPending. Empty ?token= stopped falling back to storage. searchParams.get('token') returns '', which is not null, so token became '' where the pre-#6486 truthiness check (if (tokenFromQuery)) had read sessionStorage. Normalized with || null at the source, restoring the original behavior. Found by Cursor Bugbot on #6487 (the release PR), plus a re-check of my own change while verifying its claim. Type of Change Bug fix Testing bun run type-check, bun run lint:check (23/23), vitest run app/invite (6 tests) all pass. Behavior is unchanged on every reachable path except the two defects: Path Before After Cold load, no ?token= skeleton (isPending true, empty cache) skeleton (!isTokenResolved) — same ?token=xyz isTokenResolved true → isPending unchanged Signed out isLoading false unchanged Remount w/ cached null-token entry stale accept UI for one frame skeleton — fixed ?token= (empty) queried with '' falls back to storage — restored No permanent-skeleton risk: the effect always runs on mount and sessionStorage.getItem returns string | null, never undefined, so isTokenResolved always becomes true. Not browser-tested — the changed paths are a loading frame and an empty-param edge case. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Closes two gaps left by #6486, both in apps/sim/app/invite/[id]/invite.tsx. Loading state didn't follow the query gate. #6486 gated the invitation query on isTokenResolved but left isLo...
X Description: Summary Closes two gaps left by #6486, both in apps/sim/app/invite/[id]/invite.tsx. Loading state didn't follow the query gate. #6486 gated the invitation query on isTokenResolved but left ...
Opengraph URL: https://github.com/simstudioai/sim/pull/6488
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bed88c76-0e89-a523-c5ce-bbaed2321713 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BF48:14467D:35547C:4AF33B:6AFB56CF |
| html-safe-nonce | 2dca7c366a2ae2170ffbe17ea1f503dd5a230ca0025e536ec17240f2a15a1d92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjQ4OjE0NDY3RDozNTU0N0M6NEFGMzNCOjZBRkI1NkNGIiwidmlzaXRvcl9pZCI6IjUyMzQ1MjIxOTMwMDUzMzYyNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a7924faf620a06a3f051aaa9425ff9377156c5859635ad61e5be63411f5f8f55 |
| hovercard-subject-tag | pull_request:4242330626 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6488/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Closes two gaps left by #6486, both in apps/sim/app/invite/[id]/invite.tsx. Loading state didn't follow the query gate. #6486 gated the invitation query on isTokenResolved but left isLo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width