fix(app): make ConnectButton listener lifecycle-safe #4

Merged
Naveax merged 1 commits from pr/fix-connect-button-lifecycle into main 2026-09-06 11:17:20 +03:00
Naveax commented 2026-09-03 23:27:31 +03:00 (Migrated from github.com)

Summary

Fix the ConnectButton VPN listener lifecycle.

The widget now keeps the VpnConnection instance it subscribed to instead of reading Provider again during dispose or lifecycle callbacks.

Changes

  • Store the subscribed VpnConnection instance
  • Remove the listener from the exact same instance during dispose
  • Stop pulse animation whenever the app is not resumed
  • Restore the pulse when returning to the foreground if the VPN is connected

No VPN protocol or session behavior is changed.

## Summary Fix the ConnectButton VPN listener lifecycle. The widget now keeps the VpnConnection instance it subscribed to instead of reading Provider again during dispose or lifecycle callbacks. ## Changes - Store the subscribed VpnConnection instance - Remove the listener from the exact same instance during dispose - Stop pulse animation whenever the app is not resumed - Restore the pulse when returning to the foreground if the VPN is connected No VPN protocol or session behavior is changed.
Sign in to join this conversation.