Skip to content

fix(app): warn and retry when conversation processing stalls - #12936

Merged
kodjima33 merged 3 commits into
BasedHardware:mainfrom
apoorvdarshan:fix/processing-timeout-feedback
Sep 9, 2026
Merged

kodjima33 merged 3 commits into
BasedHardware:mainfrom
apoorvdarshan:fix/processing-timeout-feedback

Conversation

@apoorvdarshan

@apoorvdarshan apoorvdarshan commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Closes #5481 (implementable slice). The homepage processing card had no feedback when summarization ran long — after 2 minutes it now shows a timeout warning and a Retry button that calls the existing reprocess endpoint. Local placeholder rows (id == 0) never time out (nothing to retry yet).

Out of scope for this PR (still open on the issue): stage labels (transcribing → summarizing → done), ETA, and background completion push.

Product invariants affected

none

How it was verified

cd app && flutter test test/unit/processing_timeout_test.dart test/widgets/processing_timeout_widget_test.dart
# 5 passed

Did not re-verify on a physical device with a live long-running conversation.

Tests

  • app/test/unit/processing_timeout_test.dart — 2-minute boundary + placeholder exemption
  • app/test/widgets/processing_timeout_widget_test.dart — warning/retry appear after timeout; absent before

Failure class (fixes)

Failure-Class: none

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 103 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @apoorvdarshan — this is a clean, well-scoped slice of #5481, and the implementation quality is good. Notes from review:

What I verified

  • app/lib/utils/processing_timeout.dart — the isConversationProcessingTimedOut predicate is nicely isolated: pure function, injectable clock, and the placeholder exemption (id == '0') is documented in the doc comment. The boundary semantics are covered exactly at the threshold by app/test/unit/processing_timeout_test.dart (1:59 → no, 2:00 → yes).
  • app/lib/pages/conversations/widgets/processing_capture.dart — good structure: now/reprocess constructor injection instead of platform mocks; the Timer.periodic ticker is canceled in dispose() and only calls setState on state transitions; _onRetry guards double-taps with _retrying and the placeholder id. Routing the retry through the existing reProcessConversationServer endpoint and updating ConversationProvider (still-processing → addProcessingConversation, finished → removeProcessingConversation + upsertConversation) matches how the provider handles replayed processing events elsewhere, so no duplicate row. The wrapping GestureDetector with an empty onTap that keeps the card's open-on-tap from firing on Retry is a thoughtful detail.
  • app/test/widgets/processing_timeout_widget_test.dart — covers both directions (warning + Retry visible after 3 minutes; absent before 2) and actually exercises the retry through the injected seam.
  • app/lib/l10n/app_en.arb — new key ships with @-metadata describing placement; real translations propagated to all locales (spot-checked de/fr/ja/zh/ru/ar — genuine, not English copies) and the generated app_localizations_*.dart files are regenerated to match.
  • Checks are green, including Dart Analyze & Tests and Generated Files.

Two non-blocking observations

  1. The 2-minute clock anchors to conversation.createdAt, so a successful retry that returns status processing does not reset the warning — the card keeps showing "still working" plus Retry. For the homepage card (which only renders the newest processing conversation) that's defensible — the work genuinely isn't done, and hiding the warning right after a retry would read as success — just flagging it so it's confirmed as intended against the issue.
  2. _onRetry uses try/finally without a catch: the realistic failure mode (reProcessConversationServer returning null) is handled with the snackbar, but a 200 with a malformed body (jsonDecode inside the API helper) would surface as an unhandled async error rather than the snackbar. Belt-and-braces only.

No split needed — the locale churn is entirely mechanical propagation of one new key. Leaving the merge sign-off to a maintainer; the implementation itself looks solid. Nice work.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Sep 7, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Real fix (closes #5481: no timeout/retry feedback on stalled processing card), tested. Not merging: PR is DIRTY (merge conflicts) and per hard rules we don't rebase/force-push branches — leaving at approve for the author/Nik to resolve the conflict.

After two minutes the homepage processing card shows a timeout message
and Retry, which re-triggers server reprocess (BasedHardware#5481). Stage labels and
completion push are left for follow-up.

Failure-Class: none
Use finishedAt (not createdAt) so long recordings are not instantly flagged,
reset the local clock after a successful retry, catch malformed reprocess
bodies with the snackbar, and assert via l10n in the widget tests.

Failure-Class: none
Drop unnecessary non-null assertions and const the FormatException.

Failure-Class: none
@cursor
cursor Bot force-pushed the fix/processing-timeout-feedback branch from 99c224e to a2ee1f6 Compare September 8, 2026 17:58
@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up review on the updated branch — both observations from the earlier automated review are resolved, and I verified the force-push lineage.

Resolved since the earlier review

  1. The timeout clock now anchors to finishedAt (capture end) rather than createdAt — _resolveProcessingStartedAt() in app/lib/pages/conversations/widgets/processing_capture.dart — and a successful retry that returns processing/merging resets _processingStartedAt and clears the warning, so the new processing pass gets a full 2-minute window.
  2. _onRetry now catches exceptions and routes them to the same somethingWentWrong snackbar as the null-response path, with a FormatException widget test covering it (app/test/widgets/processing_timeout_widget_test.dart).

Force-push note for maintainers

@kodjima33's approval sits on commit 99c224e, before cursor[bot] force-pushed the branch to resolve the merge conflicts mentioned in that approval. Verified on the current head a2ee1f6:

  • app/lib/utils/processing_timeout.dart, app/lib/pages/conversations/widgets/processing_capture.dart, and both new test files are byte-identical to the approved commit (checked by direct diff/hash).
  • The only drift vs the approved lineage is in unrelated l10n keys inherited from the newer base snapshot (speechProfileIntro wording, wantDifferentName), not from this PR; the PR's own processingTakingLonger key and its @-metadata in app/lib/l10n/app_en.arb are unchanged.
  • The branch is now MERGEABLE/CLEAN with checks green (Dart Analyze & Tests, Generated Files, Android Compile Smoke).

So the approval's substance covers the current code; depending on branch protection it may display as stale and need a re-approve click before merge.

Locale propagation spot-check held up across scripts (de/fr/ja/zh/ru/ar plus RTL he/ur) — genuine translations, and the per-locale single deletions are just trailing-comma additions on tapPlusToStartRecording, not edits to existing strings. Nice work @apoorvdarshan.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33
kodjima33 merged commit f8f809b into BasedHardware:main Sep 9, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Conversation processing timeout — no user feedback on long processing

3 participants