Repository navigation
fix(app): count only union of positive audio intervals in RecordingBlock (#23561) - #23566
Conversation
ff363b5 to
95c206e
Compare
There was a problem hiding this comment.
The duration fix is correct and well-tested; one blocking item — the required mobile changelog fragment is missing (this is what fails the Hygiene check on this head).
Findings on all three changed files:
- app/lib/pages/conversations/recording_blocks.dart — RecordingBlock.seconds now builds positive [timerStart, timerStart + seconds] intervals and returns their union via sort + merge sweep, replacing maxEnd - startSeconds. I verified the sweep handles gaps between grouped chunks, overlapping phone/device copies (counted once), containment, touching intervals, and the all-zero/negative case (returns 0 instead of an inflated span). O(n log n) on a small per-recording list — no performance concern.
- app/test/pages/conversations/recording_blocks_test.dart — the three new tests (15s not 2m 5s gap exclusion; 120s overlap + gap; zero/negative lengths) match the sweep's semantics, and the _wal helper's new originalStorage parameter is used only to construct realistic device-copy joins. Good coverage.
- app/test/widgets/on_the_way_days_test.dart — pins the rendered summary, day header, and row to 15s and asserts the old 2m 5s value no longer appears. Good end-to-end pin.
Blocking:
- The app/ production change ships without a mobile changelog fragment, so Hygiene (mobile-changelog-entry) fails. Per app/changelog/README.md, please add one JSON file under app/changelog/unreleased/, e.g. 20261025-recording-duration-gaps.json with {"change": "Recording durations no longer count pauses between consecutive chunks"} (feel free to adjust the wording).
USER IMPACT: recordings captured in consecutive chunks with short pauses will now show their actual audio length (e.g. 15s instead of 2m 5s) in the on-the-way list.
Once the fragment lands I have no further changes to request — the code change itself is ready for maintainer merge.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Added the mobile changelog fragment ( |
95c206e to
3967e71
Compare
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed the final diff at 3967e71. No merge-blocking code findings. The positive-interval union covers #23561 while retaining grouping, source files and sync metadata; the changelog fragment requested in the earlier review is present.
Independently verified 26 committed model/widget regressions and all 26 local preflight checks. Current-main negative control reproduces all four new failures. Additional synthetic reviewer checks passed for 2,000 interval sets, stable repeated reads with unchanged WAL metadata/order, and Offline Sync recording-row to original-file-sheet interaction. Current-head CI reports 7,339 tests passed with four skipped; Formatting, Hygiene and Mobile Release Eligibility pass. Cubic's neutral result is not counted as a review approval.
This completes the duration-accounting defect only. It needs a mobile release; backlog processing and customer audio recovery remain separate from this fix.
Fixes #23561
Behavior
[timerStart, timerStart + seconds]audio intervals inRecordingBlock.seconds, excluding gaps and counting overlapping copies once.This is a display-accounting correction. It does not retry or transcribe a backlog, change audio storage, establish recovery, or prove that a reported backlog contains no useful audio. Startup/recovery work remains tracked separately in #23223. No backend deployment is needed for this fix; customers need a mobile release containing it.
Maintainer verification at
3967e717b44f76a9b4acd4346b017013c6c1443bDart Analyze & TestsCI passed: 7,339 tests passed and four skipped. Formatting, Hygiene and Mobile Release Eligibility passed. Cubic was neutral because it did not automatically review the rewritten history; that is not an approval.TZ=UTC:flutter test --no-pub test/pages/conversations/recording_blocks_test.dart test/pages/conversations/offline_sync_recording_blocks_test.dart test/widgets/on_the_way_days_test.dartmake preflight: all 26 selected checks passed in a clean detached worktree at the reviewed head. Metadata-only preflight also passed.UI-Evidence: none -- Isolated duration calculation; production widgets are exercised by rendering and interaction regressions. No layout, controls or native behavior changed.
Failure-Class: none