Skip to content
Source
Sign inSign up
pingdotgg/t3code

Define shared iOS and Android activity expiry policy #10864

Closedjuliusmarminge opened this issue 2 comments
juliusmarmingecommented

The cross-platform audit of #10416 found different freshness clocks: APNs emits a stale-date relative to delivery time, while Android derives activity expiry from the activity state timestamp. Queue delays and replays can therefore leave the two cards stale at different times.

Decide which parts are shared product policy and which are native presentation constraints. Put the shared deadline calculation in the relay policy and add adapter-level cases for delayed delivery, foreground replay, stale running work, and the 15-minute completed-card window.

Keep this policy decision outside the Android feature PR. A stale marker and card removal are different native behaviors; the follow-up should make that distinction explicit rather than force identical UI.

  1. Triage

    Cross-platform consistency follow-up from the #10416 audit. iOS and Android still use different freshness clocks for the activity card. This is accepted product/policy work, not a current production bug, and it should stay outside the Android feature PR.

    What the code does today

    #10848 already extracted shared aggregation and alert policy (agentActivityAggregate.ts, agentActivityAlerts.ts, agentActivityPayloads.ts):

    • Row visibility: 2h running / 24h waiting from state updatedAt (agentActivityExpiresAt)
    • Completed/failed rows stay in the aggregate for 15 minutes from state updatedAt
    • Completion alerts are fresh for 2 minutes from state updatedAt (#10849)

    Presentation clocks were not unified:

    SurfaceClockEffect
    APNs Live Activity (ApnsClient.ts)stale-date = delivery time + 10 min; dismissal-date = delivery + 5 min (15s if contentless)iOS dims a still-present card
    Android FCM (fcmPayloads.ts in #10416)activity_expires_at = state updatedAt + 15 min (terminal) or row TTLNative code removes the card (setTimeoutAfter / alarm)

    A delayed or replayed job can therefore leave the iOS card looking fresh (deadline restarts at send) while Android has already expired it from the original state time — or the reverse for long-quiet running work (iOS dims 10 minutes after last delivery; Android keeps the card until the 2h/24h state TTL).

    A stale marker and card removal are different native behaviors. Shared policy should compute one deadline; adapters should apply it without forcing the same UI.

    Not a duplicate / not done

    • #10416 is the Android adapter. Do not fold this decision into that PR or close this when it merges.
    • #10848/#10849 share alert and row policy only.
    • #10863 is the sibling diagnostics follow-up from the same audit.
    • #10859 is queued APNs routing, not expiry.

    Suggested follow-up

    1. Put shared deadline calculation in relay policy (one helper both adapters call).
    2. Add adapter-level cases for delayed delivery, foreground replay, stale running work, and the 15-minute completed-card window.
    3. Keep iOS stale-dim vs Android removal as native presentation.

    Labels: enhancement, accepted, via-triage (remove needs-triage)

  2. juliusmarminge added labelsenhancement

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

  5. juliusmarminge assignedjuliusmarminge

  6. tanstack-source added labelsfeature

  7. Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

  8. juliusmarminge closed this

Sign in to join this conversation.