Repository navigation
Conversation
There was a problem hiding this comment.
1 issue found across 8 files
Confidence score: 4/5
- In
app/lib/pages/conversations/sync_page.dart, the device-download progress treatsStorageSync’s 1-based active-file index as a completed count, so the first file is shown as completed (1 of Y · 1%) prematurely; convert the index before passing it toSyncCa....
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/lib/pages/conversations/sync_page.dart">
<violation number="1" location="app/lib/pages/conversations/sync_page.dart:621">
P2: During device download, the first file now displays as completed (`1 of Y · 1%`) because `StorageSync` supplies a 1-based active-file index. Convert the download index to a completed count before passing it to `SyncCardProgressLine`; keep upload's already-completed count unchanged.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return parts.isEmpty ? null : parts.join(' · '); | ||
| return SyncCardProgressLine.subtitle( | ||
| phase: s.phase, | ||
| currentFile: s.currentFile, |
There was a problem hiding this comment.
P2: During device download, the first file now displays as completed (1 of Y · 1%) because StorageSync supplies a 1-based active-file index. Convert the download index to a completed count before passing it to SyncCardProgressLine; keep upload's already-completed count unchanged.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/conversations/sync_page.dart, line 621:
<comment>During device download, the first file now displays as completed (`1 of Y · 1%`) because `StorageSync` supplies a 1-based active-file index. Convert the download index to a completed count before passing it to `SyncCardProgressLine`; keep upload's already-completed count unchanged.</comment>
<file context>
@@ -610,12 +616,13 @@ class _SyncPageState extends State<SyncPage> {
- return parts.isEmpty ? null : parts.join(' · ');
+ return SyncCardProgressLine.subtitle(
+ phase: s.phase,
+ currentFile: s.currentFile,
+ totalFiles: s.totalFiles,
+ counterLabel: (processed, total) => context.l10n.syncCardProgressOf(processed, total),
</file context>
| currentFile: s.currentFile, | |
| currentFile: s.phase == SyncPhase.downloadingFromDevice && s.currentFile != null && s.currentFile! > 0 ? s.currentFile! - 1 : s.currentFile, |
There was a problem hiding this comment.
Valid. SyncCardProgressLine.subtitle now decrements the active file index during downloadingFromDevice (StorageSync is 1-based) while leaving upload currentFile (completed count) unchanged—first file shows 0/Y · 0%.
|
Verified against #4772 — this fixes both reported symptoms (percent reading as remaining, What checks out
All three concerns from the earlier bot review (mixed-drain miscounting, cross-sync scope mixing, first-file-shows-completed) are addressed on the current head, and CI is green including Dart Analyze & Tests. One note (non-blocking): Thanks for the clean fix and the responsive follow-up commits. Leaving the final merge call to the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@Git-on-my-level Thanks for the thorough pass — glad the #4772 symptoms and the earlier bot concerns check out on the current head. Noted the non-blocking follow-up about persisting |
kodjima33
left a comment
There was a problem hiding this comment.
Real fix for offline sync progress display (fixes #4772), reasonable diff with tests. Not merging: mergeStateStatus is DIRTY (merge conflicts) — per policy we don't rebase/force-push PR branches. Leaving approved; needs the author (or Nik) to rebase.
Fixes BasedHardware#4772. Before: upload progress could show remaining-based percentages (100% at start) and counters like -75/1 when multi-recording totals were clobbered by per-chunk 1/1 device reports. After: shared display helpers compute completed processed/total and 0–100% completion; sync status cards show counter + percent during upload/download and during post-upload server processing; upload progress reports after each batch; ring download ticks no longer overwrite multi-file totals. Verification: added app/test/unit/offline_processing_display_test.dart (flutter test not run on this VM — no Flutter SDK installed). Co-authored-by: Apoorv Darshan <[email protected]>
- Track WAL ids accepted (202) per sync pass; derive processed/total from that scope instead of _totalWalsToProcess vs global uploadedWals. - Reinit single-WAL sync totals; preserve multi-file counts on 1/1 download ticks. - Convert 1-based device download index to completed count in progress line. Verification: Flutter unavailable on Cloud VM; run locally: cd app && flutter test test/unit/offline_processing_display_test.dart Co-authored-by: Apoorv Darshan <[email protected]>
- dart format sync_provider.dart and offline_processing_display.dart - import BleAudioCodec in offline_processing_display_test.dart - align ActionItemsFetcher test stubs with dueStartDate/dueEndDate (BasedHardware#13570) - drop dead filesUploaded counter after reportUploadProgress refactor Verified: dart format --set-exit-if-changed on touched files; bash app/scripts/analyze_ratchet.sh; flutter test offline_processing_display_test.dart deletion_consistency_test.dart chat_content_blocks_test.dart Co-authored-by: Apoorv Darshan <[email protected]>
1cf0dc3 to
b066cd4
Compare
|
@kodjima33 Rebased |
|
Follow-up after the rebase onto Checks are green on the new head (Dart Analyze & Tests, Android Compile Smoke, Formatting, Hygiene). Also confirmed the new progress lines only render existing localized strings ( Two residual notes stay non-blocking as discussed: Thanks @apoorvdarshan — this closes out #4772 cleanly. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
app bug fix, fixes #4772: offline sync progress showed remaining-based/negative percentages. Confidence 4/5 (root cause explained, linked issue, tests added, CI green; diff slightly over the 300-line soft cap at 369 total but otherwise solid) — merging.
What changed and why
Fixes #4772.
Before: upload progress could show remaining-based percentages (100% at start) and counters like
-75/1when multi-recording totals were clobbered by per-chunk1/1device reports.After:
processed/totaland 0–100% completion (not remaining).X of Y · Z%during upload/download and post-upload server processing.total > 1.Product invariants affected
none
How it was verified
main: 8 files, +250 / −39.app/test/unit/offline_processing_display_test.dart.cd app && flutter test test/unit/offline_processing_display_test.dartFailure class (fixes)
Failure-Class: none