Shreemanarjun / Shreemanarjun/datum
Bug Report: stopAutoSync() incorrectly clears _pausedAutoSyncUserIds, preventing auto-sync restoration after pause/resume
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 27
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Hi Shreemanarjun,
I've found a critical bug in the Datum library's sync management that prevents auto-sync timers from being properly restored after calling pauseSync() followed by resumeSync().
When pauseSync() is called:
- It saves active auto-sync user IDs to
_pausedAutoSyncUserIds - It calls
stopAutoSync()without parameters
The issue is instopAutoSync()method:
// In the no-parameter path of stopAutoSync():
if (_isSyncPaused) {
_pausedAutoSyncUserIds.clear(); // ← This line clears the list!
}
This means that when resumeSync() tries to restore auto-sync timers:
for (final userId in _pausedAutoSyncUserIds) {
startAutoSync(userId);
}
// _pausedAutoSyncUserIds is now empty, so no timers are restored!
Steps to Reproduce
- Start auto-sync for one or more users
- Call
pauseSync() - Call
resumeSync() - Expected: Auto-sync timers should resume
- Actual: No auto-sync timers are restored
Thank you for your excellent library!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing pauseSync(), stopAutoSync(), and resumeSync() in the Dart sync-management code, focusing on how _pausedAutoSyncUserIds is handled. Reproduce the pause/resume sequence with one or more users and verify that auto-sync timers are restored afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100