Skip to content

Explain the paired key refreshes and share ValueBox with ungated tests - #417

Merged
alexkroman merged 2 commits into
mainfrom
claude/review-false-positives
Nov 25, 2026
Merged

alexkroman merged 2 commits into
mainfrom
claude/review-false-positives

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

What & why

A cleanup review flagged two things as duplication. Both turned out to be false positives, so this makes the code say why.

  • Account + API-key refresh pairs. AssemblyAIAccount.updateStatus refreshes the API key itself, but it returns early when the session Keychain item is .unavailable, before that call. So the app's own apiKey.refreshStatus() calls in APIKeyStepView's onAppear and ResetSection.reset() aren't redundant. A comment at the early return and at both call sites now says so.
  • Finished vs ValueBox<Bool>. Finished (a Mutex<Bool> with set()) existed only because ValueBox sat entirely inside #if os(macOS) for one CGKeyCode test double, while StreamingPCMPlayerTests is ungated. Now only that extension and its AppKit import are gated. The generic cell imports just Synchronization, and the unused Testing/BlurtEngine imports are gone. Finished.swift is deleted and StreamingPCMPlayerTests uses ValueBox(false).

Behaviour change: none.

How it was tested

  • scripts/check.sh --portable passes, as do scripts/check-swift-size.sh on the edited files and scripts/check-test-clock.sh.

  • This was written in a Linux sandbox with no Swift toolchain, so CI on macOS verifies the build, tests, swift-format, swiftlint and periphery.

  • ValueBox.swift isn't in any iPhone target: App/BlurtiOS/project.yml shares only Stubs/TestClock.swift.

  • scripts/check.sh passes (or CI will, if I'm not on a Mac)

  • I read AGENTS.md and this doesn't reintroduce anything
    deliberately removed

  • Docs updated if behavior changed


Generated by Claude Code

…ed tests

A cleanup review read the app's paired account and API-key refreshes as
redundant, since AssemblyAIAccount.updateStatus refreshes the key itself.
It doesn't when the session item is unavailable: it returns before that
call. Say so at the early return and at both app call sites
(APIKeyStepView's onAppear and ResetSection.reset) so the next pass
doesn't remove them.

The same review flagged Finished, a Mutex<Bool> with set(), as a copy of
ValueBox<Bool>. It existed only because ValueBox sat wholly inside
#if os(macOS) for one CGKeyCode double, while its user,
StreamingPCMPlayerTests, is ungated. Gate just that extension (and its
AppKit import), leave the generic cell importing only Synchronization,
drop the unused Testing/BlurtEngine imports, delete Finished, and use
ValueBox(false) in StreamingPCMPlayerTests.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC

Copy link
Copy Markdown
Collaborator Author

The ios-audits (b) failure here isn't from this PR, which changes no iPhone code. XCTest's accessibility audit of testTryItBox threw Code=-56 "Audit failed to complete in time". That is a timeout, not a finding.

The same error hit testConsent on run 45688579022, a merge-queue run on main from before this PR, and testSetupWithKey on #418. I've re-run the failed job once.

A likely fix: AccessibilityAuditTests.audit already audits a screen a second time when its findings might be flukes, but a thrown timeout skips that and fails the test. Retrying a pass that times out would close the gap. That belongs in its own PR.


Generated by Claude Code

@alexkroman
alexkroman enabled auto-merge November 25, 2026 21:11
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 25, 2026
No content conflicts: #398 moved AssemblyAIAccount.swift into
BlurtAssemblyAI, and git carried this PR's comment at the early return
along with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC
@alexkroman
alexkroman enabled auto-merge November 25, 2026 21:40
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 7feab71 Nov 25, 2026
22 checks passed
@alexkroman
alexkroman deleted the claude/review-false-positives branch November 25, 2026 22:27
alexkroman pushed a commit that referenced this pull request Nov 25, 2026
One conflict, in .claude/hooks/swift-budgets.sh: #428 added the
lint-lite rules inside the per-script scope cases this PR removed. The
size and clock checks still narrow their own arguments; check-swift-lint-
lite.sh scans what it's given, so the hook keeps one scope case for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC
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.

2 participants