Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a set of improvements to Lantern's background event handling, especially for data cap updates, and refactors how background listeners are managed. The changes enable real-time updates of data cap information via background listeners, simplify the listener management logic, and clean up unused or redundant code in the Flutter UI. Additionally, there are minor dependency updates and logging adjustments.
The most important changes are:
Background Listener Refactoring and Enhancements:
StartAutoLocationListener/StopAutoLocationListenerwith generalizedStartBackgroundListeners/StopBackgroundListenersmethods in theAppinterface and throughout the codebase, consolidating background event management for both server location and data cap updates. (lantern-core/core.go,lantern-core/mobile/mobile.go) [1] [2] [3] [4] [5] [6] [7]listeningDataCapChanges), subscribing to data cap events and notifying the Flutter frontend in real time. (lantern-core/core.go) [1] [2] [3]Data Cap Info Streaming and UI Updates:
DataCapStreammethod in theUserinterface for streaming data cap updates, and wires it into the background listener logic. (lantern-core/core.go) [1] [2]data-cap-eventmessages, updating the data cap info in the UI as soon as events are received. (lib/features/home/provider/app_event_notifier.dart,lib/features/home/provider/data_cap_info_provider.dart) [1] [2]Homewidget, since data cap info is now updated reactively via events instead of manual refreshes. (lib/features/home/home.dart) [1] [2] [3]Minor Refactors and Dependency Updates:
github.com/getlantern/ampdependency version ingo.mod.tracetodebugin the macOS app delegate for less verbose logging. (macos/Runner/AppDelegate.swift)DataUsagewidget. (lib/features/home/data_usage.dart)These changes improve the responsiveness and maintainability of the app by centralizing event handling and ensuring that data cap usage is always up to date in the UI.