Skip to content

refactor: drop the pass-through oauth state wrapper, dead apple decode, and a duplicated schedule literal - #4477

Merged
tyler-dane merged 4 commits into
mainfrom
claude/kind-dirac-07nhop
Oct 15, 2026
Merged

tyler-dane merged 4 commits into
mainfrom
claude/kind-dirac-07nhop

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Second half of the technical-debt sweep over the last 7 days of merged work. No issue; found by reviewing #4459 and #4454. (First half landed as #4476.)

What and why

A pass-through OAuth state wrapper, and the import cycle under it (#4459). buildOAuthStateForClient became a one-line forward to buildSignInOAuthState once state building moved into the auth module, leaving a second name for one thing, a cycle (desktop → auth → desktop), and a desktop flag no production caller ever sets: both web call sites pass false. The two callers now ask the module that owns sign-in state, and the desktop module keeps only the marker it owns. Its test covered the marker through the wrapper, so it now tests the marker reader directly; buildSignInOAuthState's prefix behavior stays covered by signin-oauth-state.util.test.ts.

A dead decode fallback. posthogDistinctIdFromAppleOAuthState tried base64UrlDecode, then re-did the whole parse under atob. The fallback was unreachable: base64UrlDecode only rewrites -/_ and re-pads, so it already reads standard base64, and it decodes UTF-8 where atob would mangle it. A string that got past the first decode and JSON.parse never reached the second; one that failed them would fail again. Dropped, and the Apple state shape the function exists for is now written down.

A duplicated schedule literal (#4454). Picking a start date built the same allDay schedule in both arms of an if/else, differing only in the end bound. One object, one ternary.

No behavior change in any of the three.

Verify

VERDICT: FAIL
Selected packages: core, web
Checks run: test:core, type-check, lint, knip
Checks skipped: test:a11y, test:e2e (Playwright Chromium missing)
Failed: test:web

test:core (956 pass), type-check, lint, and knip pass. The test:web failure is the sandbox RSS guard, not a test: web shard 3/6 exceeded 5000 MB RSS. Same environmental failure documented on #4476:

  • It reproduces identically on a clean origin/main worktree, stopping at the same file, SelectView.test.tsx.
  • It is cumulative process memory, not one test: raising the cap to 12 GB trips at 12 GB too, while splitting shard 3's 86 files into two halves passes both (255 + 480 tests, 0 fail).
  • Every web test passes once the memory ceiling is out of the way: shards 1, 2, 4, 5, 6 ran clean (654 / 757 / 675 / 717 / 663 pass, 0 fail) plus shard 3 in halves.

Worth a look separately: a full bun test:web cannot finish locally because of that shard, on main as much as here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM


Generated by Claude Code

…-today

Four components each subscribed to the now-cue store twice and rebuilt the
same remount key by hand, so the trick that makes a CSS animation replay was
re-explained at every call site. Fold both subscriptions into useNowCuePulse
and let it mint the key.

Also flatten scrollToNowOrPulse's nested already-at-now branch into two reads
and two statements, drop the dead motion-reduce:transition-none that rode
along with animation-only classes (the pulse utilities already carry
motion-reduce:animate-none, and none of these elements transition), and
unexport the two grid helpers that only grid.util uses.

No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM
…ple decode

buildOAuthStateForClient became a one-line forward to buildSignInOAuthState
when #4459 moved state building into the auth module, leaving a second name
for one thing, an import cycle (desktop -> auth -> desktop), and a desktop
flag no production caller ever sets: both web call sites pass false. The two
callers now ask the module that owns sign-in state, and the desktop module
keeps only the marker it owns.

posthogDistinctIdFromAppleOAuthState's atob fallback was unreachable:
base64UrlDecode already reads standard base64, since it only rewrites -/_ and
re-pads, and it decodes UTF-8 where atob would mangle it. A string that got
past the first decode and JSON.parse never reached the second, and one that
failed them would fail again. Dropped, and the Apple state shape it exists
for is now written down.

Desktop's own test covered the marker through the wrapper; it now tests the
marker reader directly, and buildSignInOAuthState's prefix behavior stays
covered by signin-oauth-state.util.test.ts.

No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM
Picking a start date built the same allDay schedule in both arms of an
if/else, differing only in the end bound. One object, one ternary.

No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Oct 15, 2026 — with Claude
@tyler-dane
tyler-dane enabled auto-merge October 15, 2026 10:37
@github-actions

Copy link
Copy Markdown
Contributor

Boot bundle: 507.6 KB gzip (-0.0 KB vs main)

@tyler-dane
tyler-dane added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 9dd0e6b Oct 15, 2026
30 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-07nhop branch October 15, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants