Network traffic: harden graph updates and preserve range state #611

Closed
opened 2026-05-06 08:55:14 +00:00 by johnny9 · 0 comments
johnny9 commented 2026-05-06 08:55:14 +00:00 (Migrated from github.com)

Scope split

The graph reset behavior originally tracked here was split into #806 so it can be implemented and reviewed independently. This issue no longer includes reset behavior.

This issue is limited to the network traffic sampling lifecycle, suppression of hidden-page work, range preservation, and safe shutdown covered by PR #805.

Code Gap

The QML network traffic page shows received/sent totals and graph history, but its updater has release risks.

NetworkTrafficTower creates a timer/thread without clear ownership or shutdown cleanup. It can continue deriving and publishing graph updates when the page is hidden, and the existing range handling needs to preserve totals and retained history consistently.

Work Needed

  • Make network traffic sampling thread/timer ownership explicit and safe during shutdown.
  • Ensure graph updates do not leak timers/threads or update QML from the wrong thread.
  • Avoid deriving or publishing graph snapshots while the page is inactive, while retaining the raw samples needed when it becomes active again.
  • Preserve totals and graph history consistently when changing ranges.
  • Add coverage for opening/closing the page, activation changes, changing ranges, and shutdown while sampling is active.
  • Reset behavior was split into #806.
  • Implementation: PR #805.
<!-- migrated-from: https://github.com/johnny9/BitcoinCoreAppDevelopment/issues/69 --> ## Scope split The graph reset behavior originally tracked here was split into #806 so it can be implemented and reviewed independently. This issue no longer includes reset behavior. This issue is limited to the network traffic sampling lifecycle, suppression of hidden-page work, range preservation, and safe shutdown covered by PR #805. ## Code Gap The QML network traffic page shows received/sent totals and graph history, but its updater has release risks. `NetworkTrafficTower` creates a timer/thread without clear ownership or shutdown cleanup. It can continue deriving and publishing graph updates when the page is hidden, and the existing range handling needs to preserve totals and retained history consistently. ## Work Needed - Make network traffic sampling thread/timer ownership explicit and safe during shutdown. - Ensure graph updates do not leak timers/threads or update QML from the wrong thread. - Avoid deriving or publishing graph snapshots while the page is inactive, while retaining the raw samples needed when it becomes active again. - Preserve totals and graph history consistently when changing ranges. - Add coverage for opening/closing the page, activation changes, changing ranges, and shutdown while sampling is active. ## Related - Reset behavior was split into #806. - Implementation: PR #805.
Sign in to join this conversation.
No description provided.