-
Notifications
You must be signed in to change notification settings - Fork 17
feat: implement battery optimizations with adaptive polling #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
uid0c0der
wants to merge
51
commits into
netbirdio:main
Choose a base branch
from
uid0c0der:battery-optimizations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+495
−67
Draft
Changes from 34 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
989c769
feat: implement battery optimizations with adaptive polling
6464cc3
fix: address code review issues - improve concurrency safety
916501c
fix: replace DispatchQueue.main.async with Task { @MainActor in }
bd8b313
fix: remove duplicate notification handlers in NetBirdApp
3e276c0
fix: synchronize all polling state access to prevent race conditions
61b45d7
fix: complete scenePhase handler with all polling management operations
91b9612
fix: remove duplicate notification handlers to prevent redundant calls
28b9202
fix: read isInBackground from pollingQueue in startTimer to prevent r…
8322eac
fix: prevent deadlock in startTimer by passing state values as parame…
0fe91e0
fix: synchronize lastTimerInterval update to prevent race condition
b7b335a
fix: prevent repeated stop() calls due to asynchronous state update t…
da5e3a6
docs: add comment explaining calculateStatusHash field selection rati…
db55401
fix: make stop guard reset unconditional on .disconnected to avoid co…
5916ea3
fix: add isPollingActive flag to prevent timer recreation after stopT…
ddf5533
fix: set isPollingActive = true in startTimer (both code paths)
c79b09b
fix: use sync in setBackgroundMode to prevent timing issue with start…
d2935ec
fix: set isPollingActive synchronously in stopTimer to prevent race c…
9269ac6
Merge branch 'netbirdio:main' into battery-optimizations
uid0c0der b2a3f49
fix: ensure timer.invalidate() is called on main thread
0a167fe
fix: correct indentation in Task block for peer info sorting
53a5a8c
fix: synchronize timer invalidation to prevent concurrent timer execu…
fd236dd
fix: avoid deadlock in startTimer by using async and adding precondition
4eeda7b
refactor: improve code quality and thread safety
0cfd0bf
perf: optimize isLoginRequired() call to avoid UI hitching
a325acc
fix: resolve Swift Concurrency warnings for pollingQueue.sync calls
56985fd
fix: ensure setBackgroundMode state update is synchronous to prevent …
2a44312
fix: always compute isLoginRequired() for accurate debug output
65cff11
fix: stop polling when app becomes inactive to save battery
ac20fe4
feat: use slower polling instead of stopping when app becomes inactive
fb2dbb4
fix: automatically start polling when extension becomes connected
233a1fc
fix: call checkExtensionState immediately after connect to start polling
77c9adc
fix: improve UI feedback during connect by polling extension state
6fc69cb
fix: update extensionStateText immediately in checkExtensionState
819fa3c
fix: make GlobalConstants public for access from NetBird target
b27ce99
fix: avoid priority inversion by increasing pollingQueue QoS
c0eb283
fix: use Set comparison for routes to match PeerInfo Equatable
de4d772
fix: add guard in timer closure to prevent work after stopTimer
b9eeb74
perf: only start polling when extension is connected in .active state
524e845
fix: add precondition to stopTimer to prevent Swift Concurrency deadlock
c6db3e0
fix: cancel existing polling task when connect() is called again
6c36bcc
fix: replace DispatchQueue with Task for connection polling cancellation
e76586a
fix: replace recursion with loop in pollExtensionStateUntilConnected
32515c2
fix: serialize getExtensionStatus() calls to prevent concurrent loadA…
ce25926
fix: improve UI feedback for disconnect by setting state immediately
ef68b4e
fix: prevent app hang on launch by adding fallback in getExtensionStatus
e60fef8
fix: delay state updates in .active case to prevent app launch hang
805caf9
fix: separate checkExtensionState delay to prevent app launch blocking
a6ed65b
fix: make checkExtensionState conditional on first launch to prevent …
bbd7e98
fix: simplify checkExtensionState logic - always delay on .active
cc5db36
fix: remove artificial delays and checkExtensionState from app launch
7392d2b
fix: remove redundant setBackgroundMode/setInactiveMode calls on app …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.