Skip to content

Preserve query and hash on silent refresh redirect #177

Description

@ryota-murakami

Summary

Silent token refresh strips ?query and #hash from the destination URL, dropping users on a different page than they came from.

Source

P2 follow-up from /ship adversarial review of PR #176 (silent GitHub token refresh).

Details

src/hooks/board/useOrganizationData.ts:65 and src/hooks/board/useRepositoryData.ts:62 (and any other call site) pass window.location.pathname only. Users on /board/abc?filter=open#card-123 land on /board/abc after refresh.

Fix

Pass ${pathname}${search}${hash} instead. sanitizeNextPath already accepts the full string.

Acceptance

  • Refresh on /board/abc?filter=open#card-123 returns to the same URL
  • All call sites updated (useOrganizationData, useRepositoryData, others)
  • No regression in existing refresh flow tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumPlan for this monthenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions