Skip to content

[Bug]: Reopening a closed pull request tab from another route leaks foreign search params and loses saved PR filters #42874

Done

Description

@AymanKhan9

Summary

Reopening a closed pull request tab (Mod+Shift+T / Reopen Closed View) from any other route—such as /issues or a chat thread—leaks the current route's URL search params into /pull-requests and drops the user's saved pull request list preferences.

Steps to reproduce

  1. Open /pull-requests, change filters (for example involvement=reviewing and state=merged, which are saved in localStorage), open a PR tab, and close it (× or Mod+W).
  2. Navigate to /issues?who=assigned&status=closed&q=login&host=linear.app&tracker=linear&scope=ENG&key=ENG-12 (or any non-/pull-requests route).
  3. Press Mod+Shift+T (Reopen Closed View).

Expected behavior

T3 Code navigates to /pull-requests using the saved PR list preferences (involvement=reviewing, state=merged) plus the reopened PR's selection params, without carrying over search params from /issues.

Actual behavior

T3 Code navigates to /pull-requests?who=assigned&status=closed&q=login&host=linear.app&tracker=linear&scope=ENG&key=ENG-12&involvement=all&state=open&repository=...&number=...:

  • Saved PR list preferences are lost and reset to involvement=all, state=open.
  • Shared param names (q, host) from /issues actively filter the PR list (e.g. host=linear.app & q=login show an empty PR list).
  • Unrelated foreign params (who, status, tracker, scope, key) pollute the /pull-requests URL.

Cause

In apps/web/src/components/ReopenClosedViewShortcut.tsx, globalPullRequests passes search: (previous) => pullRequestsSearchForRestore(previous, selected), where TanStack Router supplies the current route's search as previous, unlike the adjacent globalIssues branch (issuesSearchForRestore(readIssueListPreferences(), selected)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions