Skip to content
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

fix: fixes an issue with multiple timers being scheduled #529

Merged
merged 4 commits into from Feb 15, 2024

Conversation

BernardGatt
Copy link
Contributor

While testing on standalone I noticed that timers weren't being stopped when a new one was scheduled, this should fix the issue.

@BernardGatt BernardGatt requested a review from a team February 15, 2024 15:19
Copy link

github-actions bot commented Feb 15, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • APN-UIKit: bernard/polling-hotfix (1708012053)
  • CocoaPods-FCM: bernard/polling-hotfix (1708012091)

Comment on lines 11 to 14
if let queueTimer {
queueTimer.invalidate()
self.queueTimer = nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add this to deinit of this class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let queueTimer {
queueTimer.invalidate()
self.queueTimer = nil
}
self.queueTimer?.invalidate()
self.queueTimer = nil

Nit-picky suggestion. I think this code reads easier without the if because we are re-constructing the queueTimer in the line below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the instance is created and maintained from a static class, I don't think its required.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (05a1ebd) 55.85% compared to head (45bd4c9) 56.17%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #529      +/-   ##
==========================================
+ Coverage   55.85%   56.17%   +0.31%     
==========================================
  Files         132      132              
  Lines        3713     3715       +2     
==========================================
+ Hits         2074     2087      +13     
+ Misses       1639     1628      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BernardGatt BernardGatt merged commit ec383f1 into main Feb 15, 2024
10 checks passed
@BernardGatt BernardGatt deleted the bernard/polling-hotfix branch February 15, 2024 16:07
github-actions bot pushed a commit that referenced this pull request Feb 15, 2024
## [2.12.1](2.12.0...2.12.1) (2024-02-15)

### Bug Fixes

* fixes an issue with multiple timers being scheduled ([#529](#529)) ([ec383f1](ec383f1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants