Fix notifications and enable background data fetch while app is not focused. - #195
Merged
stopflock merged 3 commits intoSep 4, 2026
Conversation
…st location refresh. Tested on a Pixel 10 Pro. These changes were needed to work on real hardware. Also, which background location updating was working, the data was not refreshing in the background. This also adds that. It will pull nodes in a 5km area around your location and update when you within 1km of the area. These values may need to be adjusted if there is increased load on the servers.
- Increase background refresh threshold: Raised the edge distance check in GpsController from 1000m to 2500m to guarantee new Overpass data is fetched well before the user drives out of the cached bounding box. - Fix bounding box race condition: Added await to the background fetch handler in MapView so tracking bounds only shift forward after the network request successfully finishes. - Make debounced fetches awaitable: Refactored fetchAndUpdate in NodeProviderWithCache to return a Future<void> using a Completer, bridging the 400ms debounce timer. - Prevent hanging futures: Added state checks for _activeCompleter to instantly resolve canceled network requests during rapid map panning, preventing fatal StateError crashes and infinite UI hangs.
stopflock
approved these changes
Sep 4, 2026
stopflock
left a comment
Collaborator
There was a problem hiding this comment.
Has worked for me in testing. Merging.
|
|
||
| class _ProximityAlertsSectionState extends State<ProximityAlertsSection> { | ||
| class _ProximityAlertsSectionState extends State<ProximityAlertsSection> | ||
| with WidgetsBindingObserver { |
Collaborator
There was a problem hiding this comment.
Is this indentation weird or am I crazy
Collaborator
There was a problem hiding this comment.
im not checking the math here but will try to test at the extremes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Based on the branch that @kferland opened in #183.
Updated to fix notifications on real Android hardware.
Added a location bounding box that keeps track of where the user is, even when the app in not focused. When you get close to the edge of that bounding box, it will download data around the current position, update the camera cache, and then update the bounding box regions.
This was required because previously the data only downloaded when the app was focused.
Only tested on Pixel 10 Pro. Have not tested on iOS, however initial branch showed it working in an emulator.
Fixes known issue of notifications not working in general and potentially #184.