Skip to content

fix: reliable live task updates in Tasks Manager#98

Merged
mateof merged 1 commit into
developfrom
fix/tasks-live-refresh
Jul 21, 2026
Merged

fix: reliable live task updates in Tasks Manager#98
mateof merged 1 commit into
developfrom
fix/tasks-live-refresh

Conversation

@mateof

@mateof mateof commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Problem

When creating an upload/download task and navigating to the Tasks page, tables did not update live — a full page reload was needed for progress events to reach the UI.

Root causes

  • Per-model EventChanged subscriptions were only (re)wired when the component's cached list was empty (lpt.Count() == 0), so newly created models never got subscribed after the first visit.
  • The cached lists were static, shared between the Active and Queue instances of the same table component (they overwrote each other and cross-unsubscribed on Dispose), and persisted across navigations.
  • Event handlers called grid.RefreshDataAsync() from background threads without InvokeAsync, fire-and-forget, swallowing any failure.
  • Every network chunk triggered a full grid refresh (no throttling).

Changes

  • TransactionInfoService now owns all per-model subscriptions: models are hooked when they enter any list (active/pending, uploads/downloads/batch tasks) and unhooked on remove/clear. Any change — list membership or per-model progress/state — is published through a single new TransactionsChanged event, throttled to 250ms with a guaranteed trailing raise so the final state of a burst is always delivered.
  • TasksTable, UploadsTable and DownloadsTable were simplified: instance (non-static) lists, a single subscription to TransactionsChanged, refresh marshaled through InvokeAsync with exception handling. No per-model event wiring in the UI anymore.
  • The Tasks Manager header stat cards (Batch Tasks / Downloads / Uploads) now update live too.

Existing events (EventChanged, TaskEventChanged, speed history events) are kept intact for MainLayout and SpeedChart.

Task, download and upload tables required a full page reload to show
progress because per-model event subscriptions were only wired when the
component's static cached list was empty, so newly created models never
got subscribed. Static lists were also shared between the Active and
Queue table instances, and grid refreshes were fired from background
threads without dispatcher marshaling.

TransactionInfoService now owns all per-model subscriptions (hooked when
a model enters any list, unhooked on remove/clear) and exposes a single
aggregated TransactionsChanged event, throttled to 250ms with a
guaranteed trailing raise. Tables use instance lists and subscribe only
to that event, refreshing via InvokeAsync. The Tasks Manager header
stats now update live as well.
@mateof
mateof merged commit e4e29dc into develop Jul 21, 2026
@mateof
mateof deleted the fix/tasks-live-refresh branch July 21, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant