Toast the user when a processing run completes #13

Closed
opened 2026-07-05 17:10:25 +02:00 by Sirttas · 0 comments
Owner

Summary

The SSE plumbing for processing events already exists in gemory/src/activity/:
activitiesProcessed.ts opens a fetch-adapter stream against mammon's
GET /activities/processed (bearer auth flows in via the generated axios client, so
the "EventSource can't set headers" concern is moot), parses the processed event,
reconnects on drop (ref-counted, 3s delay), and drives store/resource refresh through
onActivitiesProcessed / useProcessedResource (market acquisitions, ledgers, per-page
resources).

The only piece of the original #13 still missing is the user-facing notification.
Add an app-level toast that fires on each processed event.

Scope

  • App-root listener (e.g. in App.vue) registered via onActivitiesProcessed, gated on
    useAuthStore().isAuthenticated
    : subscribe when authenticated, unsubscribe on logout /
    when isAuthenticated flips false (watch the store).
  • On each processed event, fire an info-type toast via the existing toast helper —
    one toast per event, relying on the existing 5s auto-dismiss (no coalescing/debounce).

Out of scope

  • The SSE client, bearer auth, store/resource refresh, and reconnect lifecycle — already
    implemented.
  • Success vs. failure differentiation — the backend emits a bare processed event with no
    payload, so it is not representable. No mammon follow-up.
  • The backend SSE endpoint (mammon; already exists).

Acceptance criteria

  • While authenticated, completing a processing run shows an info toast.
  • No toast fires before login or after logout.
  • The toast subscription never triggers a pre-login 401 / spurious login redirect.

Related

  • mammon SSE endpoint: ProcessingController#streamProcessing /
    SseUserActivitiesProcessedListener.
  • Existing frontend plumbing: gemory/src/activity/activitiesProcessed.ts,
    onActivitiesProcessed, useProcessedResource.
## Summary The SSE plumbing for processing events already exists in `gemory/src/activity/`: `activitiesProcessed.ts` opens a fetch-adapter stream against mammon's `GET /activities/processed` (bearer auth flows in via the generated axios client, so the "EventSource can't set headers" concern is moot), parses the `processed` event, reconnects on drop (ref-counted, 3s delay), and drives store/resource refresh through `onActivitiesProcessed` / `useProcessedResource` (market acquisitions, ledgers, per-page resources). The only piece of the original #13 still missing is the **user-facing notification**. Add an app-level toast that fires on each `processed` event. ## Scope - App-root listener (e.g. in `App.vue`) registered via `onActivitiesProcessed`, **gated on `useAuthStore().isAuthenticated`**: subscribe when authenticated, unsubscribe on logout / when `isAuthenticated` flips false (watch the store). - On each `processed` event, fire an **`info`-type** toast via the existing `toast` helper — one toast per event, relying on the existing 5s auto-dismiss (no coalescing/debounce). ## Out of scope - The SSE client, bearer auth, store/resource refresh, and reconnect lifecycle — already implemented. - Success vs. failure differentiation — the backend emits a bare `processed` event with no payload, so it is not representable. No mammon follow-up. - The backend SSE endpoint (mammon; already exists). ## Acceptance criteria - While authenticated, completing a processing run shows an `info` toast. - No toast fires before login or after logout. - The toast subscription never triggers a pre-login 401 / spurious login redirect. ## Related - mammon SSE endpoint: `ProcessingController#streamProcessing` / `SseUserActivitiesProcessedListener`. - Existing frontend plumbing: `gemory/src/activity/activitiesProcessed.ts`, `onActivitiesProcessed`, `useProcessedResource`.
Sirttas added the
Status
To Refine
label 2026-07-09 19:30:25 +02:00
Sirttas added a new dependency 2026-07-14 17:54:05 +02:00
Sirttas changed title from Subscribe to processing SSE stream and notify the user when a run completes to Toast the user when a processing run completes 2026-07-16 14:50:35 +02:00
Sirttas added Kind/Feature
Priority
Low
4
and removed
Status
To Refine
labels 2026-07-16 14:50:41 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: eveal/gemory#13