Skip to content

Dispose manual ping cooldown timer#9

Open
robekl wants to merge 3 commits intoMeshMapper:devfrom
robekl:fix/manual-ping-cooldown-dispose
Open

Dispose manual ping cooldown timer#9
robekl wants to merge 3 commits intoMeshMapper:devfrom
robekl:fix/manual-ping-cooldown-dispose

Conversation

@robekl
Copy link
Copy Markdown
Contributor

@robekl robekl commented Mar 11, 2026

Problem

The manual ping cooldown timer was created and used for periodic UI updates, but it was not disposed when app state was torn down. That leaves a live timer behind after provider disposal, which is a lifecycle leak and can cause unnecessary work after teardown.

Change

Added explicit disposal for the manual ping cooldown timer during app-state cleanup.

Why This Fixes It

The timer now follows the same ownership and teardown path as the other countdown timers. That removes the leaked periodic callback and ensures no timer-driven updates survive provider disposal.

@MrAlders0n
Copy link
Copy Markdown
Contributor

Nice catch! Before I merge this, could you also add _manualPingCooldownTimer.stop() to the disconnect/cleanup paths where the other timers are already stopped? Right now it's missing from:

  1. User disconnect
  2. BLE disconnect handler
  3. Reconnect cleanup
  4. Auto-ping stop

The 15s self-stop makes it low-risk, but since you're already fixing this timer's lifecycle it'd be good to make it complete in one PR. Let me know if you have time to add that!

@robekl
Copy link
Copy Markdown
Contributor Author

robekl commented Mar 23, 2026

Let me know if you have time to add that!

Done!

@446564 446564 requested a review from MrAlders0n as a code owner April 15, 2026 21:34
@446564
Copy link
Copy Markdown
Collaborator

446564 commented Apr 15, 2026

can you pull and run dart format then commit the formatting changes?

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.

3 participants