Skip to content

fix(app): respect task export choice and recover push registration - #24182

Merged
aryanorastar merged 22 commits into
mainfrom
codex/caelis-notifications-task-routing
Nov 6, 2026
Merged

aryanorastar merged 22 commits into
mainfrom
codex/caelis-notifications-task-routing

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #24179.

Tasks created on iPhone could also create Apple Reminders solely because EventKit permission was granted, even with Todoist selected. Bulk Export chose the first connected app instead of the saved default. Both now respect the saved destination; unknown, failed or disconnected status never falls back to Apple. Cloud export no longer waits for an unrelated EventKit permission check. Failed status lookup offers Try Again; changed selection/account and concurrent-tap guards remain.

Existing authenticated sign-in/Home/AppShell hooks share a bounded notification registrar for delayed APNs, refused saves, permission/foreground wakes and token rotation. A rotation consumed during APNs acquisition also consumes its queued wake, preventing a redundant SDK read from replacing it with an older token. Later rotations still run next. Accepted receipts deduplicate writes; account changes revoke old work without admitting a replacement owner. Intercom remains best effort. Guarded HTTP auth-error side effects recheck their owner, including replay responses, while successful receipts retain their existing behavior.

Verified runtime source: ac60c9f56f59bf0bb90bc9ce9d164bf58e44ceca, including main integration at 6d2fd72991. Current head: f3d5f28f72d28da02acba354e5e6cb2c363fc818; its only changes align two no-op test/integration fixtures with the new optional permission-refresh parameter. Earlier runtime/simulator evidence remains applicable.

  • Three added regressions failed before the follow-up fixes: consumed token rotation and stalled/failed unrelated Apple permission.
  • 63 focused Flutter tests passed after main integration. Changed-source analysis is clean.
  • 41 related backend tests passed in isolated files. The five new HTTP cases also passed in the locked worktree environment and normal push gate: production task-create route → actual background automatic worker → Todoist adapter → export marker, with Apple connected and no FCM token. Includes acceptance, 401, 503 and disconnected-provider cases; no Apple fallback. Token-save refusal/retry also reaches the shared push sender.
  • Isolated iPhone 16 Pro / iOS 26.5 simulator compiled and ran the production Export UI/provider/HTTP path. With Apple permission deliberately stalled, refused status produced Try Again and zero writes; retry after restoration produced one Todoist request and zero Apple creates. Delayed APNs plus a refused first registration receipt recovered to two saves, the second accepted.
  • All 31 hermetic mobile journeys passed on clean exact head (31 executed, zero failed/skipped). make preflight passed 45 selected checks; all 65 normal bounded push gates passed, including generated output and API compatibility. Final diff reviewed; no remaining reproducible code blocker found in these flows.

The simulator and backend tests substitute auth identity, persistence and external Firebase/APNs/EventKit/Todoist I/O. They do not establish real lock-screen delivery, live Todoist grant validity, physical-device behavior or this customer's account recovery. External provider contracts/configuration are unchanged. The simulator's task-create stub is not automatic-worker evidence; the new backend HTTP tests provide that separate coverage.

Main reconciliation

Verified locally at a729784e33cf9290107d97c7d06efd81200a1583. The task provider uses one saved-destination export path and forwards the completion state supported by main. Account guards still fence the status read, native write and acknowledgement. The two fixture callbacks now accept main’s optional idempotency key.

  • 94 focused Flutter tests passed, including a completed task created through the real provider, saved destination, notification registration, session fencing and task delivery.
  • All 5 focused backend task/push pipeline tests passed through backend/test.sh.
  • The previously recorded simulator and journey results cover the unchanged routing and registration flows. The completed-state regression exercises the real create provider through its native-write fixture.

All 47 local preflight checks and the normal push gates passed.

The prior f3d5f28f72 revision passed full mobile CI. Fresh CI is required for this merge commit.

Release the backend before the mobile build to enforce ordered FCM registration. The optional request and Firestore fields need no backfill. Customer-specific automatic Todoist and notification confirmation remain Support follow-up, separate from merge readiness. No historical task migration or account mutation is included.

Architecture/checklist: app/docs/task-export-and-push-registration.md. Private simulator screenshots, receipts and commands are recorded in the case's technical review evidence.

Failure-Class: FC-split-mutation-authority

Invariants: INV-DATA-1 (existing production routing), INV-UI-1 and INV-UI-3 (existing localized controls/feedback/theme), INV-PERF-1 (asynchronous SDK/network waits).

INV-TASK-2: The Apple Reminders acknowledgement updates export metadata on an existing explicitly created task. The integration inventory records that writer and the task capture admission rules stay intact.

UI-Evidence: none -- Existing layout, theme and navigation retained; retry uses existing localized feedback controls. Running iOS simulator interaction screenshots are recorded separately.

Android CI toolchain

The reconciliation CI exposed a shared runner mismatch. The Android compile and JVM test jobs now set Java 21 before Flutter setup, matching the existing emulator job. Gradle 8.14.2 ran successfully with Java 21 in a local smoke probe. Actionlint, five infrastructure guard tests and the CI budget refresh passed.

CI follow-up source: e4ab62dd7479b7c7e3d10ecc535eed3d088fce02. Product source and the tested reconciliation are unchanged by the workflow-only follow-up.

Token ordering follow-up

Registration attempts reserve a device-local order before sending. Transport retries reuse it. Firestore compares the order and commits the token and schedule timezone in one transaction. Superseded writes receive 409 and identical retries preserve newer schedule settings. Older clients can continue registering without the optional field.

  • 97 focused Flutter tests passed. On 869e92c68b, the 25 affected registration, notification admission and HTTP guard tests also passed after moving the order reservation to the registration owner. Coverage includes overlapping reservations after clock rollback and sign-out, and 401 refresh and replay across account switches.
  • 45 targeted backend unit tests passed through the repository runner.
  • 22 loopback Firestore tests passed. The production HTTP route rejected a delayed old token and a conflicting same-order write, preserved the opt-out and newer timezone, and accepted identical retries and unversioned requests.
  • Regenerated app-client OpenAPI and affected TypeScript bindings. The existing simulator evidence still covers task routing and the registration lifecycle. The new emulator proof covers ordered server persistence with synthetic tokens.

The repository task-writer contract suite passed all 29 tests after registering the Apple Reminders acknowledgement.

Apple Reminders acknowledgement recovery

Automatic and manual bulk export use the same account-scoped task marker saved in EventKit. A retry finds the original reminder across readable lists and reuses its identifier while preserving edits. Concurrent exports share the in-flight lookup. Duplicate requests for one task use a single native save. Manual export reports success after the owner-scoped backend link is acknowledged.

All 39 focused Flutter tests and the full Flutter analyzer ratchet passed. The completed-task test now uses the lifecycle status returned by the backend. The unchanged task-writer contract passed all 29 tests.

The updated production export paths passed on a dedicated iPhone 16 Pro simulator with iOS 26.5 and real EventKit. A loopback backend saved the completed task's link and withheld its acknowledgement. The manual retry returned the original identifier and preserved the edited reminder and its completion. Concurrent exports of two distinct tasks with the same title kept separate reminders, and duplicate requests returned the same ID. A different account's request was rejected. Authentication and the backend were synthetic.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: well-scoped, carefully fenced fix — no blocking issues found; two UX notes worth a look before this leaves draft.

Correctness (verified on 6fc6816):

  • app/lib/services/integrations/automatic_apple_reminders_export.dart — export() requires a fresh backend status with default_app == 'apple_reminders' AND connected: true AND EventKit permission, re-checking session currency between each await; unknown/failed/disconnected status returns false with no Apple fallback. This directly fixes the bug(ios): task creation bypasses the selected export app; push registration lacks recovery #24179 routing bug (permission ≠ destination).
  • app/lib/pages/action_items/widgets/task_selection_action_bar.dart — _handleExport resolves the saved default via resolveExportTarget() instead of TaskIntegrationApp.values.where(isAppConnected).first, cancels if the selection changes mid-flight (setEquals check), and guards re-entry with _exportInProgress.
  • app/lib/providers/task_integration_provider.dart — resolveExportTarget() waits for pending default writes, forces a silent status refresh, and refuses to authorize on load error, unconfirmed default, or session/read-generation change. Sound.
  • app/lib/backend/http/shared.dart — rechecking the owner (ensureCurrentOwner) before the 401 refresh/replay and before deleted-account session expiry (including replay responses) is a genuine hardening of the shared path; the new late-401/403 and replay cases in app/test/unit/backend/http/account_deletion_fence_test.dart cover it.
  • app/lib/services/notifications/fcm_token_registration.dart + notification_service_fcm.dart — one registration owner with epoch/generation fencing, bounded (20s) reads, a bounded 1s→60s retry ladder, listeners installed once, Intercom best-effort after an accepted receipt. The (_saved == (token, zone)) dedupe avoids re-posting accepted receipts while still persisting timezone changes.
  • app/lib/backend/http/api/notifications.dart — saveFcmTokenServer now reports the accepted receipt (status == 'Ok') instead of fire-and-forget logging, which is what makes the retry logic correct.
  • app/pubspec.yaml / pubspec.lock — firebase_messaging_platform_interface ^4.6.5 is dev-only and the lock resolves to the same version/sha as before (transitive → direct dev); no version drift.

UX:

  • Export now performs a forced backend status refresh bounded by statusTimeout (45s default) with the button disabled during resolution; on a slow link that is a noticeable wait versus the old instant export.
  • When resolveExportTarget() returns null because the status read failed (offline), the bar shows the "connect a task app" nudge even though e.g. Todoist is connected — consider a distinct "couldn't confirm your default, try again" message for that case.

Cost: one extra GET /v1/task-integrations per manual task creation on Apple platforms, and one forced status read per bulk export. Negligible.

Security: no new permissions or data flows; the session-fencing changes reduce cross-account contamination risk (a stale owner can no longer refresh tokens or expire the replacement session), and tokens/task text stay out of the new diagnostic logs.

Blast radius: shared.dart's rechecks affect every API call that passes a canSend guard — today only the new registration/export callers, so legacy callers are unchanged; that invariant is worth a maintainer's eye as other call sites adopt canSend.

USER IMPACT: tasks you create or bulk-export go to the task app you actually selected (e.g. Todoist) instead of silently landing in Apple Reminders, and push notification registration recovers on its own after delayed APNs/startup hiccups or a refused save.

Still wanted as a reviewer: the two UX items above; a real-device push round (app/integration_test/task_notification_recovery_capture.dart is synthetic loopback only, and the unchecked journey/CI boxes in app/docs/task-export-and-push-registration.md capture this honestly); and maintainer sign-off on the shared-HTTP session-fencing semantics before 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.

@Git-on-my-level Git-on-my-level added flutter flutter work needs-maintainer-review Needs a human maintainer to sign off before merge labels Oct 31, 2026
@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Nov 1, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the production change is correct, carefully guarded, and well tested; I found no blocking issue - but it rewrites authenticated push-registration and export-routing behavior in one pass, so I am leaving it for human maintainer sign-off rather than a sign-off from automation.

Verified on head f3d5f28:

  • app/lib/services/integrations/automatic_apple_reminders_export.dart (new) - the core routing fix. The old _syncToAppleRemindersIfNeeded (removed from action_items_provider.dart) exported to Apple on EventKit permission alone; the new export() gate requires the server's default_app == 'apple_reminders', a connected integration, and native permission, and rechecks the session owner (current()) between every await, including before the updateActionItem acknowledge. Permission alone no longer routes a Todoist-selected task into Apple Reminders.
  • app/lib/providers/task_integration_provider.dart - resolveExportTarget() replaces first-connected-app routing for Bulk Export: it awaits pending default writes, force-refreshes status without the EventKit check (refreshApplePermission: false), and refuses to export on unknown/disconnected/errored status (_hasConfirmedDefault gate, tested for null/''/unknown/trello in task_export_destination_test.dart). The statusTimeout-bounded read releases the Export button with Try Again instead of hanging.
  • app/lib/services/notifications/fcm_token_registration.dart (new) - single-owner registrar: bounded 20s SDK reads via ConnectionRead, capped retry schedule (1s..60s), accepted-receipt dedupe (_saved), epoch invalidation so an old account's in-flight persist cannot land under a replacement session, and coalescing so a rotation consumed during APNs acquisition does not trigger a redundant SDK read that could overwrite a newer token.
  • app/lib/services/notifications/notification_service_fcm.dart - removes the old 10x1s APNs polling loop in saveNotificationToken; listeners install exactly once (_registrationListenersInstalled/_messageListenersInstalled guards) before first token lookup; register() is admitted only through authenticated entry points (_registrationReady, revoked on sessionGenerationEvents); foreground resume re-admits. Intercom send is now conditional on an accepted, still-current save (previously fired even after a failed save) - intentional per the doc, worth knowing.
  • app/lib/backend/http/shared.dart - narrow, defensive hardening: ensureCurrentOwner() recheck before 401 refresh/replay and before account-deletion session expiry (beforeExpire), so a stale registration response cannot refresh tokens or expire the replacement account. I verified the canSend/signOutOn401/ensureCurrentOwner machinery this builds on is pre-existing on main; the diff only adds the rechecks.
  • app/lib/backend/http/api/notifications.dart + task_integrations.dart + action_items.dart - guarded callers pass canSend and set signOutOn401: false when owned (a refused/401 token save defers to the retry schedule instead of signing the user out); behavior for unguarded callers is unchanged (signOutOn401 keeps previous semantics when canSend == null).
  • backend/tests/unit/test_mobile_task_push_pipeline.py - real production routes/workers with synthetic storage/provider I/O: asserts the cloud automatic Todoist handoff works with zero FCM tokens (across connected/disconnected and 201/401/503 provider outcomes) and that a refused token save can retry and unlock the shared push sender.
  • app/pubspec.yaml / pubspec.lock - firebase_messaging_platform_interface ^4.6.5 added as a dev dependency only (official FlutterFire package, used by the test fake in fcm_registration_admission_test.dart); no runtime dependency change.
  • app/docs/task-export-and-push-registration.md - checked against the code; the routing rules, retry-budget semantics, and log hygiene (only runtimeType logged - no tokens, no task text) match what I read in the diff.
  • Remaining files (changelog fragment, integration-test capture, the four new/updated test files) are consistent with the above; task_delivery_capture.dart / task_delivery_test.dart are mechanical signature updates for the new optional parameter.

Material dimensions:

  • Security/auth: owner rechecks before every guarded side effect; stale responses cannot borrow a replacement account for refresh or session expiry; no new endpoints (same v1/users/fcm-token and task-integration calls).
  • UX: Bulk Export goes to the saved default and offers Try Again on status failure; push registration recovers after delayed APNs, permission grant, or foreground resume instead of silently giving up.
  • Blast radius: iOS push registration and automatic task routing for all app users; the failure mode is deferred retry (late notifications), not data loss or wrong-account writes.

USER IMPACT: tasks are exported to the app you actually selected (no surprise Apple Reminders entries when Todoist is chosen), and notification registration recovers on its own after sign-in delays or a missed first attempt.

What I would still want: the PR body's own unchecked items (repository mobile journeys run and exact-head CI confirmation), and a ready-for-review flip when you consider it final - it is currently a draft. A human maintainer should sign off on the registration/routing rewrite before 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.

Keep the saved export destination and session guards while forwarding the completion state supported by main.
The hosted default Java 25 fails during Gradle 8.14.2 build-script analysis. Match the emulator job pin and protect the JVM and compile jobs with the existing infrastructure contract.
@aryanorastar
aryanorastar marked this pull request as ready for review November 6, 2026 09:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T15:35:44.813670Z 7ec23a1 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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.

3 issues found across 25 files

Confidence score: 4/5

  • task_notification_recovery_capture.dart is not formatted, so the pre-push hook will reject the changed Dart file. Run dart format on the block.
  • notifications.dart silently retries when a 200 response has a status other than 'Ok'. Log the unexpected status before returning false.
  • The release note in 20261031-task-routing-push-recovery.json uses implementation jargon, which obscures the user-visible notification outcome. Reword it around what users can expect.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/backend/http/api/notifications.dart">

<violation number="1" location="app/lib/backend/http/api/notifications.dart:29">
P3: A 200 response whose `status` is not `'Ok'` now returns `false` with no log, so the retry loop runs silently. Log the unexpected status before returning, as the removed code did.</violation>
</file>

<file name="app/integration_test/task_notification_recovery_capture.dart">

<violation number="1" location="app/integration_test/task_notification_recovery_capture.dart:96">
P3: This block is not `dart format` output, and the pre-push hook runs `dart format --set-exit-if-changed` on changed Dart files, so it will be rejected. Reformat the `ActionItemsProvider`, `TaskIntegrationProvider`, `FcmTokenRegistration`, and `runApp(MultiProvider(...))` calls with `dart format --line-length 120`.</violation>
</file>

<file name="app/changelog/unreleased/20261031-task-routing-push-recovery.json">

<violation number="1" location="app/changelog/unreleased/20261031-task-routing-push-recovery.json:2">
P3: This mobile release note uses implementation jargon (`Push registration`, `delayed setup`) instead of describing the user-visible notification outcome. Say that push notifications recover after a delay and when the user returns to the app.</violation>
</file>

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread app/lib/backend/http/shared.dart Resolved
Logger.debug(data.status == 'Ok' ? "Token saved successfully" : "Token save returned ${data.status}");
} else {
Logger.debug("Failed to save token");
return data.status == 'Ok';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: A 200 response whose status is not 'Ok' now returns false with no log, so the retry loop runs silently. Log the unexpected status before returning, as the removed code did.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/backend/http/api/notifications.dart, line 29:

<comment>A 200 response whose `status` is not `'Ok'` now returns `false` with no log, so the retry loop runs silently. Log the unexpected status before returning, as the removed code did.</comment>

<file context>
@@ -14,19 +14,20 @@ Future<void> syncUserTimeZoneServer({required String timeZone}) async {
-    Logger.debug(data.status == 'Ok' ? "Token saved successfully" : "Token save returned ${data.status}");
-  } else {
-    Logger.debug("Failed to save token");
+    return data.status == 'Ok';
   }
+  Logger.debug('Push token persistence deferred (status=${response?.statusCode})');
</file context>
Suggested change
return data.status == 'Ok';
if (data.status == 'Ok') return true;
Logger.debug('Push token save returned ${data.status}');
return false;

await request.response.close();
publish();
});
final tasks = ActionItemsProvider(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This block is not dart format output, and the pre-push hook runs dart format --set-exit-if-changed on changed Dart files, so it will be rejected. Reformat the ActionItemsProvider, TaskIntegrationProvider, FcmTokenRegistration, and runApp(MultiProvider(...)) calls with dart format --line-length 120.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/integration_test/task_notification_recovery_capture.dart, line 96:

<comment>This block is not `dart format` output, and the pre-push hook runs `dart format --set-exit-if-changed` on changed Dart files, so it will be rejected. Reformat the `ActionItemsProvider`, `TaskIntegrationProvider`, `FcmTokenRegistration`, and `runApp(MultiProvider(...))` calls with `dart format --line-length 120`.</comment>

<file context>
@@ -0,0 +1,179 @@
+    await request.response.close();
+    publish();
+  });
+  final tasks = ActionItemsProvider(
+      automaticAppleRemindersExport: AutomaticAppleRemindersExport(
+    permission: () async => true,
</file context>

@@ -0,0 +1,3 @@
{
"change": "Task exports respect your selected integration when Apple Reminders is also connected. Push registration retries delayed setup and reconnects after returning to the app."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This mobile release note uses implementation jargon (Push registration, delayed setup) instead of describing the user-visible notification outcome. Say that push notifications recover after a delay and when the user returns to the app.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/changelog/unreleased/20261031-task-routing-push-recovery.json, line 2:

<comment>This mobile release note uses implementation jargon (`Push registration`, `delayed setup`) instead of describing the user-visible notification outcome. Say that push notifications recover after a delay and when the user returns to the app.</comment>

<file context>
@@ -0,0 +1,3 @@
+{
+  "change": "Task exports respect your selected integration when Apple Reminders is also connected. Push registration retries delayed setup and reconnects after returning to the app."
+}
</file context>

@aryanorastar
aryanorastar marked this pull request as draft November 6, 2026 09:13

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4ab62dd74

ℹ️ 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".

Comment on lines +102 to +105
final read = ConnectionRead<Object?>(operation, deadline);
_read = read;
try {
return await read.future as T;

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 Prevent timed-out FCM writes from committing late

When the FCM POST exceeds this 20-second wrapper deadline, ConnectionRead only times out its own future; it does not cancel persist (the HTTP write deadline is 300 seconds). A retry or newer-token attempt can therefore start while the old POST is still live. Since backend/database/notifications.py overwrites the same device_key document, an older token request that completes last can replace the newly accepted token and disable push delivery. Bound or cancel the actual write, or serialize and revalidate writes before persisting a later token.

Useful? React with 👍 / 👎.

await writes;
if (generation != _sessionGeneration || !identical(writes, _defaultWrites)) return null;
final choice = _defaultChoice;
final loading = loadFromBackend(forceRefresh: true, silent: true, refreshApplePermission: false);

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 Fence the export status read to its account

If the user switches accounts while this status GET is in flight, the new export path calls _fetchStatus without canSend; the default getTaskIntegrations therefore leaves signOutOn401 enabled. A stale 401 can be refreshed and replayed using the replacement account, and a rejected replay can expire that session; a stale account-deletion 403 can likewise expire the current session. The provider generation check only prevents applying the result, not these HTTP auth side effects. Capture the owner and pass a guard to this read and any connection-repair writes. 401s in this client are automatically refreshed and retried.

AGENTS.md reference: app/AGENTS.md:L127-L131

Useful? React with 👍 / 👎.

@mintlify

mintlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Nov 6, 2026, 10:03 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

Failure-Class: FC-split-mutation-authority
@aryanorastar
aryanorastar marked this pull request as ready for review November 6, 2026 11:12

@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.

2 issues found across 36 files

Confidence score: 3/5

  • In automatic_apple_reminders_export.dart, if the acknowledgement write fails after reminder creation, a later manual export can create a duplicate reminder. Delete the created reminder when the acknowledgement fails.
  • In sign_out.dart, the push-registration ordering metadata is under a heading that conflicts with the list’s documented policy. Give it a separate comment explaining why it survives sign-out.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/pages/settings/sign_out.dart">

<violation number="1" location="app/lib/pages/settings/sign_out.dart:36">
P3: This key is push-registration ordering metadata, not a display or phone-behaviour preference, so it sits under the wrong heading for this list's documented policy. Give it its own comment that says why it survives sign-out (keeps the write order monotonic across sign-in cycles).</violation>
</file>

<file name="app/lib/services/integrations/automatic_apple_reminders_export.dart">

<violation number="1" location="app/lib/services/integrations/automatic_apple_reminders_export.dart:70">
P2: If the acknowledgement write fails after `_create` succeeds, the EventKit reminder stays on the device while the task is still unexported. A later manual export creates a second reminder. Delete the created reminder when acknowledgement or the ownership check fails.</violation>
</file>

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

View guided diff | Turn on auto-fix | Re-trigger cubic

if (!await _permission() || !current()) return false;
final reminder = await _create(item);
if (reminder == null || !current()) return false;
return await _acknowledge(item.id, reminder, current) && current();

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: If the acknowledgement write fails after _create succeeds, the EventKit reminder stays on the device while the task is still unexported. A later manual export creates a second reminder. Delete the created reminder when acknowledgement or the ownership check fails.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/services/integrations/automatic_apple_reminders_export.dart, line 70:

<comment>If the acknowledgement write fails after `_create` succeeds, the EventKit reminder stays on the device while the task is still unexported. A later manual export creates a second reminder. Delete the created reminder when acknowledgement or the ownership check fails.</comment>

<file context>
@@ -0,0 +1,77 @@
+      if (!await _permission() || !current()) return false;
+      final reminder = await _create(item);
+      if (reminder == null || !current()) return false;
+      return await _acknowledge(item.id, reminder, current) && current();
+    } catch (error) {
+      // A failed read never selects a fallback destination or logs task text.
</file context>

'companionAssociationPrompted',
'autoSyncOfflineRecordings',
// Display and phone behaviour
fcmRegistrationOrderKey,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This key is push-registration ordering metadata, not a display or phone-behaviour preference, so it sits under the wrong heading for this list's documented policy. Give it its own comment that says why it survives sign-out (keeps the write order monotonic across sign-in cycles).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/pages/settings/sign_out.dart, line 36:

<comment>This key is push-registration ordering metadata, not a display or phone-behaviour preference, so it sits under the wrong heading for this list's documented policy. Give it its own comment that says why it survives sign-out (keeps the write order monotonic across sign-in cycles).</comment>

<file context>
@@ -32,6 +33,7 @@ const Set<String> kPreferencesKeptOnSignOut = {
   'companionAssociationPrompted',
   'autoSyncOfflineRecordings',
   // Display and phone behaviour
+  fcmRegistrationOrderKey,
   SharedPreferencesUtil.appearanceDefaultMigrationKey,
   SharedPreferencesUtil.appearanceModeKey,
</file context>
Suggested change
fcmRegistrationOrderKey,
// Push registration write order: stays monotonic across sign-in cycles
fcmRegistrationOrderKey,

@aryanorastar
aryanorastar marked this pull request as draft November 6, 2026 11:20
Failure-Class: FC-split-mutation-authority

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce5ad1cd98

ℹ️ 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".

final Future<bool> Function(String, String, bool Function()) _acknowledge;

Future<bool> export(ActionItemWithMetadata item, {required bool Function() canContinue}) async {
if (!_available() || item.exported || item.appleReminderId?.isNotEmpty == true || item.status != 'active') {

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 Allow completed tasks through Apple export

When a task is created with completed: true, CanonicalTaskCreate normalizes its status to completed, so this guard returns before creating a reminder. The new path passes the completion state to addReminder, and the commit’s docs and test expect completed tasks to sync; allow completed tasks here while still rejecting archived or cancelled tasks.

Useful? React with 👍 / 👎.

aryanorastar added a commit that referenced this pull request Nov 6, 2026
## What changed and why

Home conversation rows now show an accessible task badge, and Search →
Has tasks browses the full server result set with query/date/folder/star
filters. Both surfaces use the same current, undeleted canonical task
links; completed and manually linked tasks count, while stale summary
suggestions do not.

Closes #20620. Source-conversation task-row links remain the separate
scope of #19859.

The membership join and candidate scans are bounded and read-only.
Signed cursors bind the account and filters and support sparse pages.
Only selected task-bearing results can receive existing paid-access
recovery. The change adds no task writes, recording-content writes,
backfill or Firestore indexes. Backend deployment must precede the
mobile release.

Reuses the shared stale-HTTP-error guards and regressions from #24182
(`e53adc5fd0`, `6fc6816804`), retaining current main's newer streaming
behavior. Existing task/conversation notifications invalidate badges;
old-account responses cannot repaint or expire a replacement session.
The architecture, checklist, release order and local rerun commands are
in `backend/docs/conversation-task-filter.md`.

## Product invariants affected

- INV-DATA-1: first-party data routing/auth authority is preserved;
native QA is loopback-only with synthetic identity and an isolated
Firestore emulator.
- INV-UI-1 / INV-UI-3: shared conversation rows, accessible localized
badges and existing search/date controls; Back preserves the original
Home/search route.
- INV-PERF-1: mounted-row reads are batched/bounded; failures cannot
create rebuild/retry loops, and the production performance shell is
regenerated.

## How it was verified

- Native iPhone 17 Pro / iOS 26.5 simulator: production widgets and API
decoders → real loopback FastAPI routes → real Firestore emulator.
Passed Home badge, matches beyond loaded Home rows, starred
intersection, injected 503/retry, 403 cached-result hiding/recovery,
canonical deletion refresh and Back position restoration. Final
screenshots were visually reviewed.
- 3 real Firestore/HTTP integration cases passed; 11 focused backend
filter regressions and 16 API-surface contract tests passed. Public,
app-client and integration schema checks pass; the two new routes remain
first-party only.
- 611 query/contract tests passed; a separate compatibility/rate-limit
batch passed 149 with one existing skip. These batches overlap and are
not a unique-test total.
- 34 focused Flutter regressions passed, including real provider
notification binding, unchanged-selection no-op, per-row badge updates,
old-account responses and error paths, access-refusal redaction,
malformed responses, empty continuation, failed retry, search/date
compatibility, discarded visibility preference and Android
large-text/semantics checks.
- All 31 selected hermetic mobile journeys passed (`make mobile-verify
ARGS="fast --paths ..."`).
- Shared HTTP ownership regressions passed with the earlier focused
batch; implementation is unchanged since that run.

Authentication, Redis and external search-provider I/O in local
integration are synthetic. The native host reuses production
conversation rows and the production filter page; it is not the full
authenticated Home shell. No physical Android TalkBack run, production
deployment, store release or customer confirmation is claimed. Android
semantics/large text are exercised in Flutter widget tests. All 69
selected local repository preflight checks and all 27 production-shell
performance checks passed. Keep draft until required current-commit CI
passes.


## Main reconciliation

Verified locally at `7c4941ff329aca0f4a046e2b39249aea90c3af6d`. Merged
current main, preserved every existing locale entry and both task-filter
translations, and regenerated Dart localizations for all 49 locales. The
Home regression now asserts the combined `• 10m` label rendered by the
row.

- 30 focused Flutter tests passed, including the previously failing Home
case, task-filter rendering and routing, presence invalidation and
stale-session HTTP guards.
- 27 backend tests passed through `backend/test.sh` across the task
filter and OpenAPI contracts.
- `python3 scripts/l10n.py check` passed. The previously recorded
simulator and Firestore checks cover the same feature behavior.

All 69 local preflight checks and the normal push gates passed.

## Tests

`backend/tests/unit/test_conversation_task_filter.py`,
`backend/tests/integration/test_conversation_tasks_emulator.py`,
executable Firestore query drivers,
`app/test/unit/conversation_task_presence_test.dart`,
`app/test/unit/backend/http/conversation_tasks_api_test.dart`,
`app/test/widgets/conversations_with_tasks_test.dart`, and
`app/integration_test/conversation_tasks_e2e_test.dart` cover the new
core and recovery paths. The local QA server rejects non-loopback
emulators/cloud projects and never uses customer data.

## UI evidence

Production conversation rows in the synthetic QA Home host, then the
production Has tasks page; both on the iOS 26.5 simulator with local
emulator data.

![Home task
badge](https://raw.githubusercontent.com/BasedHardware/omi/2740a90903/.agent-artifacts/ui-evidence/20620-conversation-task-filter/001-mobile-ios-home-task-badge.png)
![Has tasks
results](https://raw.githubusercontent.com/BasedHardware/omi/2740a90903/.agent-artifacts/ui-evidence/20620-conversation-task-filter/002-mobile-ios-conversations-with-tasks.png)

## Failure class (fixes)

Failure-Class: FC-raw-page-limit-before-visibility-filter

## Android CI toolchain

The reconciliation CI exposed a shared runner mismatch. The Android
compile and JVM test jobs now set Java 21 before Flutter setup, matching
the existing emulator job. Gradle 8.14.2 ran successfully with Java 21
in a local smoke probe. Actionlint, five infrastructure guard tests and
the CI budget refresh passed.

CI follow-up source: `5503c2dcd8ab20c10bf3989d7077370b9e64d5f6`. Product
source and the tested reconciliation are unchanged by the workflow-only
follow-up.

## Account and pagination follow-up

Owner checks fence 401 refresh and replay across account switches. Task
search advances through raw index pages while public search retains
visible-result pagination. Task browse and search read candidates
without restoring access until the result page is selected. The 120/hour
task-presence cap remains effective under the production rate
multiplier.

- 34 focused Flutter tests passed on `a78454f41c`, including account
switches during 401 refresh and replay, new-owner badge reads while an
old request is pending, invalid cursor recovery, large page decoding on
the background worker and the episode navigation test.
- 148 focused backend unit tests passed with one existing skip.
- Five production HTTP and Firestore emulator tests passed. Browse and
search unlocked only returned task-bearing conversations. Search
advanced past a page of hidden, stale and malformed hits and preserved
the public response's privacy. The next page unlocked its own returned
row.
- The production widgets and loopback Firestore flow passed again on the
dedicated iPhone 17 Pro / iOS 26.5 simulator at `241c23c540`. Coverage
includes the Home badge, global results, injected 503 and 403 responses,
deletion refresh and return to the original Home position. The new
backend regressions use synthetic auth, entitlement and search inputs.

Line-Count-Exception: backend/routers/conversations.py | 2539 -> 2574 |
Share authoritative search hydration and exact-reference handling with
task discovery. Keep public redaction and pagination separate from the
read-only candidate path.

Five Firestore emulator tests passed again with synthetic auth. They
cover the document cap across search hydration and retention of
folder-curated conversations. All 57 affected backend unit and inventory
tests passed.
Failure-Class: FC-split-mutation-authority
@aryanorastar
aryanorastar marked this pull request as ready for review November 6, 2026 14:23

@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.

5 issues found across 40 files

Confidence score: 3/5

  • AppleRemindersService.swift rejects write-only Reminders access during export, so manual and automatic task exports can fail for users with that permission. Align the export guard with the permission flow.
  • fcm_token_registration.dart drops a tokenless refresh that arrives during an in-flight attempt, so a timezone change or wake can go unpersisted. Schedule a rerun after the pending attempt finishes.
  • fcm_token_registration.dart can return from refresh(token: ...) before a coalesced token rotation is persisted. Await the follow-up registration before completing the returned future.
  • AppleRemindersService.swift fetches all reminders for each task export, making bulk export work grow with both task count and total reminders. Reuse one lookup per batch.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/services/integrations/apple_reminders_service.dart">

<violation number="1" location="app/lib/services/integrations/apple_reminders_service.dart:125">
P3: This catch logs only `error.runtimeType`, which is always `PlatformException` for native failures, so the native code and message are lost. Log `code` and `message` the way `addReminder` does. The log text also says "deferred" for failures that may be permanent, such as an owner mismatch.</violation>
</file>

<file name="app/lib/services/notifications/fcm_token_registration.dart">

<violation number="1" location="app/lib/services/notifications/fcm_token_registration.dart:89">
P2: A refresh without a token that arrives while an attempt is in flight is dropped. `_run` returns the pending future without scheduling a rerun, so a timezone change or wake after the attempt's zone read is not persisted until the next refresh. Mark any refresh that arrives during flight for a rerun, not only token offers.</violation>

<violation number="2" location="app/lib/services/notifications/fcm_token_registration.dart:103">
P2: A coalesced token rotation is launched unawaited, so `refresh(token: ...)` can complete before the rotated token is persisted. Await the follow-up from `whenComplete` so the returned registration future covers both attempts.</violation>
</file>

<file name="app/ios/Runner/AppleRemindersService.swift">

<violation number="1" location="app/ios/Runner/AppleRemindersService.swift:291">
P2: Write-only Reminders authorization now makes both manual and automatic task exports fail: the permission check accepts `.writeOnly`, but this new export guard requires read access and the request path never upgrades it to full access. Request full/read access for this task-aware lookup, or handle an initial write-only export separately while preserving recovery for read-capable access.</violation>

<violation number="2" location="app/ios/Runner/AppleRemindersService.swift:311">
P2: Each task export fetches every reminder in every calendar just to find one marker. Bulk export repeats this per task, so the cost grows with tasks times total reminders. Consider one lookup per batch, or a narrower predicate such as the target list, to avoid repeated full scans.</violation>
</file>

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment on lines +89 to +92
if (pending != null) {
if (token?.isNotEmpty == true) _again = true;
return pending;
}

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: A refresh without a token that arrives while an attempt is in flight is dropped. _run returns the pending future without scheduling a rerun, so a timezone change or wake after the attempt's zone read is not persisted until the next refresh. Mark any refresh that arrives during flight for a rerun, not only token offers.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/services/notifications/fcm_token_registration.dart, line 89:

<comment>A refresh without a token that arrives while an attempt is in flight is dropped. `_run` returns the pending future without scheduling a rerun, so a timezone change or wake after the attempt's zone read is not persisted until the next refresh. Mark any refresh that arrives during flight for a rerun, not only token offers.</comment>

<file context>
@@ -0,0 +1,175 @@
+    _retry = null;
+    if (token?.isNotEmpty == true) _offeredToken = token;
+    final pending = _inFlight;
+    if (pending != null) {
+      if (token?.isNotEmpty == true) _again = true;
+      return pending;
</file context>
Suggested change
if (pending != null) {
if (token?.isNotEmpty == true) _again = true;
return pending;
}
if (pending != null) {
_again = true;
return pending;
}

let owner = args["ownerUid"] as? String, !owner.isEmpty,
let taskID = args["actionItemId"] as? String, !taskID.isEmpty,
owner == UserDefaults.standard.string(forKey: "flutter.uid"),
hasRemindersAccess(readRequired: true) else {

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: Write-only Reminders authorization now makes both manual and automatic task exports fail: the permission check accepts .writeOnly, but this new export guard requires read access and the request path never upgrades it to full access. Request full/read access for this task-aware lookup, or handle an initial write-only export separately while preserving recovery for read-capable access.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/ios/Runner/AppleRemindersService.swift, line 291:

<comment>Write-only Reminders authorization now makes both manual and automatic task exports fail: the permission check accepts `.writeOnly`, but this new export guard requires read access and the request path never upgrades it to full access. Request full/read access for this task-aware lookup, or handle an initial write-only export separately while preserving recovery for read-capable access.</comment>

<file context>
@@ -276,7 +281,59 @@ class AppleRemindersService {
+              let owner = args["ownerUid"] as? String, !owner.isEmpty,
+              let taskID = args["actionItemId"] as? String, !taskID.isEmpty,
+              owner == UserDefaults.standard.string(forKey: "flutter.uid"),
+              hasRemindersAccess(readRequired: true) else {
+            result(FlutterError(code: "EXPORT_UNAVAILABLE", message: "Task reminder export is unavailable", details: nil))
+            return
</file context>

final delay = retryDelays[_retryIndex++];
_retry = Timer(delay, () => unawaited(_run(resetBudget: false)));
}
}).whenComplete(() {

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: A coalesced token rotation is launched unawaited, so refresh(token: ...) can complete before the rotated token is persisted. Await the follow-up from whenComplete so the returned registration future covers both attempts.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/services/notifications/fcm_token_registration.dart, line 103:

<comment>A coalesced token rotation is launched unawaited, so `refresh(token: ...)` can complete before the rotated token is persisted. Await the follow-up from `whenComplete` so the returned registration future covers both attempts.</comment>

<file context>
@@ -0,0 +1,175 @@
+        final delay = retryDelays[_retryIndex++];
+        _retry = Timer(delay, () => unawaited(_run(resetBudget: false)));
+      }
+    }).whenComplete(() {
+      if (!identical(_inFlight, work)) return;
+      _inFlight = null;
</file context>

'completed': item.completed,
});
} catch (error) {
Logger.debug('Task reminder export deferred: ${error.runtimeType}');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This catch logs only error.runtimeType, which is always PlatformException for native failures, so the native code and message are lost. Log code and message the way addReminder does. The log text also says "deferred" for failures that may be permanent, such as an owner mismatch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/services/integrations/apple_reminders_service.dart, line 125:

<comment>This catch logs only `error.runtimeType`, which is always `PlatformException` for native failures, so the native code and message are lost. Log `code` and `message` the way `addReminder` does. The log text also says "deferred" for failures that may be permanent, such as an owner mismatch.</comment>

<file context>
@@ -108,6 +109,24 @@ class AppleRemindersService {
+        'completed': item.completed,
+      });
+    } catch (error) {
+      Logger.debug('Task reminder export deferred: ${error.runtimeType}');
+      return null;
+    }
</file context>
Suggested change
Logger.debug('Task reminder export deferred: ${error.runtimeType}');
final detail = error is PlatformException ? '${error.code}: ${error.message}' : '${error.runtimeType}';
Logger.debug('Task reminder export failed: $detail');

@aryanorastar
aryanorastar marked this pull request as draft November 6, 2026 14:30
Use the backend completed lifecycle state and share an in-flight EventKit lookup across task exports.

Failure-Class: FC-split-mutation-authority
@aryanorastar
aryanorastar marked this pull request as ready for review November 6, 2026 15:14

@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.

No issues found across 40 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Turn on auto-fix | Re-trigger cubic

@aryanorastar
aryanorastar merged commit 05dcd60 into main Nov 6, 2026
66 checks passed
@aryanorastar
aryanorastar deleted the codex/caelis-notifications-task-routing branch November 6, 2026 15:19

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ec23a13f4

ℹ️ 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".

let status = EKEventStore.authorizationStatus(for: .reminder)
if #available(iOS 17.0, *) {
return status == .fullAccess || status == .writeOnly || status == .authorized
return status == .fullAccess || status == .authorized

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 Preserve write-only access for existing reminder operations

On iOS 17+ when a user has .writeOnly Reminders authorization, this shared helper now reports no permission. Existing paths such as batch sync and reminder creation also use it, so the change disables those operations rather than limiting full-access requirements to the new task-identity lookup. Keep write-only access for existing operations and require full access only where reminders must be read.

Useful? React with 👍 / 👎.

Comment on lines +208 to +209
await writes;
if (generation != _sessionGeneration || !identical(writes, _defaultWrites)) return null;

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 Keep timed-out default writes from overtaking the latest choice

When two default changes overlap and the first PUT takes longer than statusTimeout, setSelectedApp's ConnectionRead times out without cancelling its HTTP request; its finally then completes _defaultWrites. This resolver can therefore read the newer choice before the older PUT lands, after which that late write can overwrite the backend default and route bulk export to the superseded app. Keep the actual request in the write chain or fence default writes server-side.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work needs-maintainer-review Needs a human maintainer to sign off before merge positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(ios): task creation bypasses the selected export app; push registration lacks recovery

2 participants