laststance / laststance/gitbox

401 interceptor races freshly-set provider token cookie

Open
#180 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2-medium
Dominant language
TypeScript
Stars
5
Forks
2
Avg merge
6h 9m
Merged PRs (30d)
2

Description

Summary

axios 401 interceptor unconditionally clears the GitHub provider token cookie, racing with refresh.

Source

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

Details

src/lib/axios-github.ts:101-110 unconditionally calls deleteGitHubTokenCookie() on any 401. A stale request resolving after refresh completes can nuke the fresh cookie.

Fix

Gate deletion on the in-flight token matching the current cookie value.

Acceptance

  • Stale 401 does not delete fresh cookie
  • Test simulates race between stale request and refresh

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/lib/axios-github.ts:101-110, where the 401 interceptor deletes the GitHub provider token cookie. Trace the in-flight token and current cookie value, then add a test that simulates a stale request racing with refresh. Done means a stale 401 leaves the freshly set cookie intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.