Skip to content

fix: clean up recording stop and snapshot traversal#640

Merged
thymikee merged 1 commit into
mainfrom
codex/record-snapshot-cleanup
Jun 1, 2026
Merged

fix: clean up recording stop and snapshot traversal#640
thymikee merged 1 commit into
mainfrom
codex/record-snapshot-cleanup

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Jun 1, 2026

Summary

Centralize short record-stop finalization errors for iOS simulator and Android recording paths, remove redundant invalid-output cleanup logic, and reuse snapshot descendant traversal helpers for iOS presentation rules.

Closes #635

Touched 8 files; scope stayed within recording stop/finalization and snapshot presentation traversal.

Validation

Focused unit coverage passed for record-trace, iOS presentation, and snapshot capture behavior: 65 tests passed.

Typecheck passed, oxlint passed with denied warnings, full format passed, and smoke tests passed: 6 tests passed.

pnpm check:unit was attempted but still fails in this local sandbox on unrelated listener, mocked subprocess, adb/xcrun, and Swift typecheck cases; the touched focused suites pass.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Size Report

Metric Base Current Diff
JS raw 1.1 MB 1.1 MB +932 B
JS gzip 357.3 kB 357.7 kB +313 B
npm tarball 456.0 kB 456.4 kB +331 B
npm unpacked 1.5 MB 1.5 MB +932 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.3 ms 28.6 ms +0.2 ms
CLI --help 43.8 ms 45.5 ms +1.7 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/record-trace.js +546 B +184 B
dist/src/2415.js +386 B +129 B

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0285d59c5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export function buildRecordStopFailure(
message: string,
recording: RecordingStartedAt,
now = Date.now(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Measure short recordings at stop request time

Because this defaults now to the time the error is formatted, the short-recording check can miss the exact case it is meant to explain. For example, a user can run record stop immediately, but the iOS simulator path reaches this helper only after waitForStableFile/isPlayableVideo, and the Android path waits for remote stability plus pull validation before formatAndroidStopFailure; those waits can push elapsed time past 1000ms even though the requested recording duration was under the limit, so the actionable “wait at least 1000ms” hint and too-short cleanup are skipped. Capture the stop-request timestamp before finalization/validation waits and pass it into this helper.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the codex/record-snapshot-cleanup branch from 0285d59 to 3d89079 Compare June 1, 2026 12:58
Copy link
Copy Markdown
Member Author

thymikee commented Jun 1, 2026

Reconciled the review feedback in 3d89079c0:

  • Captured stopRequestedAt at the start of record stop and threaded it through iOS simulator and Android stop failure formatting, so the too-short threshold/message use the user stop time rather than later finalization time.
  • Removed invalid iOS simulator output on all local stop/finalization failure paths, including simctl timeout, instead of tying cleanup only to tooShort.
  • Added delayed-finalization coverage for iOS and delayed-stop-failure coverage for Android.
  • Removed the extra node.rect guard from iOS action wrapper suppression and adjusted the backdrop dismiss test to cover rect-less wrappers.

Validation rerun: focused record-trace/iOS presentation/snapshot capture unit tests (67 passed), typecheck, oxlint with denied warnings, full format, git diff --check, and smoke tests (6 passed).

@thymikee thymikee merged commit 096785b into main Jun 1, 2026
18 checks passed
@thymikee thymikee deleted the codex/record-snapshot-cleanup branch June 1, 2026 13:12
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-01 13:13 UTC

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.

Follow-ups from iOS perf PRs (#630, #632, #633, #634)

1 participant