Skip to content

fix(dashboard): send double-nested pagination in OrgDomains' list query#721

Closed
lakhansamani wants to merge 1 commit into
mainfrom
fix/dashboard-org-domains-pagination
Closed

fix(dashboard): send double-nested pagination in OrgDomains' list query#721
lakhansamani wants to merge 1 commit into
mainfrom
fix/dashboard-org-domains-pagination

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Summary

  • web/dashboard/src/components/OrgDomains.tsx's fetchDomains() sent pagination: { limit: 100 }, but ListOrgDomainsRequest.pagination is PaginatedRequest, which itself wraps a pagination: PaginationRequest field (internal/graph/schema.graphqls) — the correct shape is double-nested: pagination: { pagination: { limit: 100 } } }
  • The wrong shape meant every _org_domains query failed server-side with GRAPHQL_VALIDATION_FAILED — silently swallowed (res.data?._org_domains?.org_domains || [] never checked res.error), so the verified-domains table always rendered "No verified domains yet." even when domains existed
  • This feature (added in feat(dashboard): add verified org domains UI #707) has never worked since it shipped — every org admin managing verified domains through the dashboard UI would see an empty list regardless of what was actually configured
  • Also adds the missing res.error handling fetchDomains lacked, matching the exact pattern already used by every other mutation handler in this file (RequestOrgDomain/VerifyOrgDomain/AddVerifiedOrgDomain/DeleteOrgDomain)
  • Added a regression test asserting the exact query variable shape sent — the existing test file's mock client had no schema awareness, which is why this went unnoticed by the pre-existing unit tests for as long as the feature existed

Found while building an e2e spec that drives this UI through a real browser and backend (not the mocked client the existing unit tests use).

Test plan

  • npx vitest run src/components/OrgDomains.test.tsx — 6/6 pass (5 pre-existing + 1 new regression test asserting the correct double-nested shape)
  • Full npx vitest run (web/dashboard) — 43/43 pass, no regressions
  • npm run build clean

ListOrgDomainsRequest.pagination is PaginatedRequest, which itself
wraps a `pagination: PaginationRequest` field
(internal/graph/schema.graphqls) - fetchDomains sent the single-nested
`pagination: { limit: 100 }`, which the server rejected on every call
with GRAPHQL_VALIDATION_FAILED. The error was silently swallowed
(`res.data?._org_domains?.org_domains || []` never checked res.error),
so the verified-domains table always rendered "No verified domains
yet." even when domains existed - this feature (added in #707) has
never worked since it shipped.

Also adds the missing res.error handling fetchDomains lacked, matching
every other mutation handler in this file, and a regression test
asserting the exact query variable shape sent (the existing test
file's generic client mock never validated variable shape against a
real schema, which is why this went unnoticed by the pre-existing
unit tests).

Found while building an e2e spec to drive this UI through a real
browser and backend.
@lakhansamani

Copy link
Copy Markdown
Contributor Author

Superseded by #723 (pagination schema standardization), which was built directly on top of this fix and includes it inline — both PRs touched the exact same lines in OrgDomains.tsx/OrgDomains.test.tsx. #723 has now merged, so this branch's diff is fully redundant (and now conflicts, since main already contains equivalent content in a different shape). Closing rather than force-resolving conflicts for a no-op.

@lakhansamani
lakhansamani deleted the fix/dashboard-org-domains-pagination branch July 23, 2026 22:24
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