Repository navigation
fix(app): stop the scheduler spinning behind Home's live dot after a conversation opens - #23076
Merged
Merged
Conversation
…conversation opens Opening a conversation queued its analytics through SchedulerBinding.scheduleTask(…, Priority.idle). While any ticker runs the default scheduling strategy declines an idle task, and SchedulerBinding re-arms a zero-delay timer every event-loop turn until it can run; with a capture live, Home's live dot pulses indefinitely, so the UI isolate busy-looped from the tap onward, through a processing conversation's indeterminate bar, and on Home again after the pop. The analytics call now defers with Timer.run, and the capture card's own 1-second setState stops while the episode row draws the capture. Guards in app/test/perf/home_after_detail_perf_test.dart: the scheduling strategy is consulted zero times on open and the open still reaches analytics; five ticks rebuild only LiveEpisodeClock; three open/close visits leave no ticker or rebuild behind; ten list identity replacements cost one shell build per mounted row each. Failure-Class: new
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ndow Luna round 1 P2: the midnight rollover timer (armed from DateTime.now()) can fire inside a measured 5-tick window on the fake clock, rebuilding the page shell and with it the clock element, so the exact count of five could read six. The clock now only has to tick each second; the shell bound (at most one rebuild per window) carries the per-tick amplification guard.
Member
Author
|
Luna review round 1: SHIP (
|
This was referenced Oct 21, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 21, 2026
## What changed and why Home title rendering could stall long enough for iOS to terminate the app during a scene update. Build 1.0.571 (1433), sourced from `8015f02c`, reports `EXC_CRASH / SIGKILL`, FRONTBOARD `0x8BADF00D`, after exhausting a 10-second scene-update allowance. UUID-matched App.framework and Flutter.framework dSYMs resolve the sampled stack to `CharacterRange::Canonicalize -> RegExpParser -> String.replaceAll -> repairPass (note_citations.dart:106) -> repairNoteCitations -> presentableNoteTitle -> conversationRowTitle -> ConversationListItem` during `WidgetsBinding.drawFrame`. The native timer is the engine frame/vsync timer. This snapshot does not show `SchedulerBinding._runTasks`; #23076 fixes a separately reproduced idle-task spin. Citation repair now reuses fixed Unicode speaker patterns and skips per-ID Unicode boundary pattern construction when the literal ID is absent. Rendering an ordinary short title previously compiled patterns for every ID in its transcript, even though none appeared in the title. Citation output and stored data remain unchanged. ## Product invariants affected INV-PERF-1: remove repeated Unicode regexp compilation from the title-rendering path. The new shared contract regression covers a long transcript on each row. Failure-Class: new UI-Evidence: none -- presentation utility optimization, with existing title rendering and citation parity tests preserved; no widget layout or visible copy change. ## Verification - 88 targeted Flutter tests passed: citation contract, title/fallback behavior, list-row isolation, and detail-title rendering. New cases cover overlapping literal IDs, BMP/astral Unicode boundaries and Arabic digits in speaker labels. - Identical synthetic host workload (30 short titles, 1500 IDs each): old implementation **9.915 seconds**, fixed implementation **11.4 milliseconds**. The old implementation fails the new 3-second coarse watchdog-class budget; the fixed implementation passes. These are host measurements, not iPhone frame times. - Full citation contract fixtures, protected Markdown/code/link cases and title bracket preservation remain green. - Native evidence identifies the expensive sampled path; physical-device acceptance of the new binary remains required. No backend/listen deployment is needed. Crash artifacts contain private device metadata and remain outside Git. This PR includes no raw crash report, production account data, user identifiers, or credentials. Crashlytics access used `ro-prod`; discovery-verified filters and full report view returned no issue groups for builds 1431–1434, while an unfiltered positive control returned 25 groups. ASC also had no ingested incident submission; the device report arrived directly. `make preflight`: all 25 selected checks passed. Analyzer: no issues on both changed Dart files. Independent Luna round 1 via `infra/rollout/bin/review.sh`: SHIP, no P0/P1. Exact reviewed head: `edf3fd773309358618fe757b30904b4536f72d80`.
Git-on-my-level
added a commit
that referenced
this pull request
Oct 21, 2026
Prepares App Store release notes for the next stable 1.0.571 build, covering pendant audio continuity, scrolling/freezes/crashes, catching-up status on the Device page, and the live recording timer. Follows the existing 1.0.568 release JSON format and omits the beta-gated episodes UI. Store submission is separately gated on the processed TestFlight build containing #23076, #23054, and #23044, green tests/CI and tester eligibility. Submission will use MANUAL release with no phased release; David controls release. Android rollout is unchanged. Validation: mobile changelog schema and derived iOS notes passed; 14 preflight checks passed. Independent Luna review: SHIP, no P0/P1; applied its suggested wording for catch-up details and the per-second live-page timer. GitHub CI must finish green at the final head before merge. Product invariants: no production behavior changes (release-note data only).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
P36: David reported Home scrolling "very laggy sometimes, like after opening a conversation"
(iPhone, TestFlight 1.0.571, 10-21 22:35 local).
Root cause:
ConversationListItem._openqueued the "conversation opened" analytics throughSchedulerBinding.scheduleTask(…, Priority.idle). Flutter's default scheduling strategy declinesan idle task while any ticker runs, and
_runTasksthen re-armsTimer.runevery event-loopturn until the task can run. Home's live episode row pulses its dot for as long as a capture is
live, so from the tap onward the UI isolate busy-looped: through the push, through a processing
conversation's indeterminate bar (the detail page animates, so the task still cannot run), and
again on Home after the pop, where the dot keeps it spinning indefinitely. The same shape OOMs a
widget test: the pump never returns and the tester grows to 34 GB.
conversation_list_item.dart: the analytics call is deferred withTimer.runinstead; itstill runs off the navigation frame and no longer depends on the scheduler's priority gate.
processing_capture.dart: the capture card's own 1-second ticker skipssetStatewhile thelive episode row is drawing the capture (the card renders nothing then); a call still ticks.
Measured and left as is: one list identity replacement rebuilds each mounted row's shell once
(20 rows per update here; the per-row
Selectorkeeps row content from rebuilding), andConversationDetailProvider.setProvidersstill notifies on every list-provider update (nothing onHome listens to it, so no Home cost).
Product invariants affected
INV-PERF-1 (named because this adds a guard): no idle-priority scheduler task from a surface
that can animate.
Failure-Class: new
UI-Evidence: none -- no pixel changes: a deferred analytics call changes how it is scheduled, and the capture card skips a setState while it renders nothing; the Home render is unchanged.
How it was verified
app/test/perf/home_after_detail_perf_test.dart, hermetic: the realConversationsPagewith apushed
ConversationDetailPageunder the production provider wiring, a streaming capture withthe pulsing live row, 30 list projections, and a 1500-line hydration through the detail endpoint.
the old code it fails at 51), and the open is still reported to analytics.
LiveEpisodeClock: 5, noConversationListItem, at most one page-shell rebuild); the old capture card ticked 5×.transientCallbackCountat baseline with the same tick profile.10 rows (bounded by the list length).
Both guards are red on origin/main and green with the fix.
flutter testovertest/perf,test/pages/conversations,test/spineand the 14 widget tests that touch these files:453 passed, 0 failed.
flutter analyzeon the changed files andcheck_mobile_ui_isolate.py --report: clean. Layer: host widget tests; not measured on a device.