Repository navigation
Sync on the configured interval - #1294
Merged
Merged
Conversation
The periodic sync slept ten seconds at a time and synced when that woke to find sync_interval_secs elapsed. Any other event restarted the sleep, so on a busy wallet the periodic sync could be postponed indefinitely, and a configured interval under ten seconds was rounded up to ten. The sleep now runs to the interval measured from the last sync, and a zero interval is treated as one second so the loop cannot spin.
The SDK re-fetches a pending payment that it no longer reads in its offset-based sync, but it did so only once the payment was a minute old, whatever sync interval the app configured. A minute is the default interval, and until then the SDK can still find the payment in its next sync. It now waits one sync interval, at most a minute: an app that syncs more often learns a payment's outcome sooner, and the default stays as it was.
roeierez
approved these changes
Nov 2, 2026
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.
While speeding up the integration tests in #1182, we saw that the SDK did not sync on the
sync_interval_secsof 5 seconds that the tests set. It synced at most every 10 seconds, and later still while the wallet kept emitting events. One test also waited for the SDK to report a failed payment, which the SDK did only once the payment was a minute old.sync_interval_secsafter the previous full sync.