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: background queue timer scheduling and running #114

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

levibostian
Copy link
Contributor

@levibostian levibostian commented Jan 14, 2022

Fixes: #115

There were a few problems with the queue timer.

  1. There was a bug converting seconds to milliseconds and back to seconds. This has been fixed by removing the complexity of using seconds and milliseconds and now only using seconds. No conversion is done between the two now.
  2. The SimpleTimer may have scheduled a timer, but it sometimes was not triggering when the timer finished. This has been fixed by using DispatchQueue.main.async { in the timer for scheduling and canceling.

@levibostian levibostian linked an issue Jan 14, 2022 that may be closed by this pull request
@levibostian levibostian self-assigned this Jan 14, 2022
Copy link
Contributor

@ami-aman ami-aman left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@levibostian levibostian merged commit 6be8a74 into alpha Jan 19, 2022
@levibostian levibostian deleted the levi/fix-background-q-timer branch January 19, 2022 00:35
github-actions bot pushed a commit that referenced this pull request Jan 19, 2022
# [1.0.0-alpha.31](1.0.0-alpha.30...1.0.0-alpha.31) (2022-01-19)

### Bug Fixes

* background queue timer scheduling and running ([#114](#114)) ([6be8a74](6be8a74))
@ami-ci
Copy link
Contributor

ami-ci commented Jan 19, 2022

🎉 This PR is included in version 1.0.0-alpha.31 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

ami-ci pushed a commit that referenced this pull request Jan 19, 2022
# [1.0.0-beta.2](1.0.0-beta.1...1.0.0-beta.2) (2022-01-19)

### Bug Fixes

* add createdAt timestamp to added queue tasks  ([#106](#106)) ([46aab62](46aab62))
* automatic screenview tracking correct siteid ([#120](#120)) ([abd3ea9](abd3ea9))
* background queue timer scheduling and running ([#114](#114)) ([6be8a74](6be8a74))
* change hostname for CIO API ([#109](#109)) ([90e9407](90e9407))
* more safely handle 5xx, 401 status codes ([#107](#107)) ([d56807b](d56807b))
* mutex locks shared across instances ([#119](#119)) ([cb169bf](cb169bf))
* opened push metrics being sent to API again ([#111](#111)) ([93971bf](93971bf))
* remove custom jsonencoder public functions ([#122](#122)) ([061a568](061a568))
* screen view tracking ([#108](#108)) ([f836b9a](f836b9a))
* track events type in HTTP requests ([#117](#117)) ([745d4ad](745d4ad))

### Features

* add [String:Any] support to identify & track ([#94](#94)) ([5a220c4](5a220c4))
* add screen view tracking ([#82](#82)) ([c2034a6](c2034a6))
* create background queue  ([#99](#99)) ([80fffb8](80fffb8))
* subsequent identifies without passing identifier ([#96](#96)) ([47d9166](47d9166))
@ami-ci
Copy link
Contributor

ami-ci commented Jan 19, 2022

🎉 This PR is included in version 1.0.0-beta.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

ami-ci pushed a commit that referenced this pull request Jan 19, 2022
# 1.0.0 (2022-01-19)

### Bug Fixes

* add createdAt timestamp to added queue tasks  ([#106](#106)) ([46aab62](46aab62))
* automatic screenview tracking correct siteid ([#120](#120)) ([abd3ea9](abd3ea9))
* background queue timer scheduling and running ([#114](#114)) ([6be8a74](6be8a74))
* call callback on main thread APN tokens ([#40](#40)) ([982ce9d](982ce9d))
* change hostname for CIO API ([#109](#109)) ([90e9407](90e9407))
* convert APN device token to string ([#39](#39)) ([1f64a13](1f64a13))
* deep links previously being ignored ([#79](#79)) ([2041767](2041767))
* duplicate entries for active workspace ([#124](#124)) ([c903e4a](c903e4a))
* improve user-agent with more detail ([#74](#74)) ([4301034](4301034))
* logs now show up in mac console app ([#80](#80)) ([535d0be](535d0be))
* more safely handle 5xx, 401 status codes ([#107](#107)) ([d56807b](d56807b))
* mutex locks shared across instances ([#119](#119)) ([cb169bf](cb169bf))
* opened push metrics ([#70](#70)) ([a277378](a277378))
* opened push metrics being sent to API again ([#111](#111)) ([93971bf](93971bf))
* remove apn device token profile request body ([#41](#41)) ([61946c4](61946c4))
* remove custom jsonencoder public functions ([#122](#122)) ([061a568](061a568))
* rename singletons instance to shared ([#34](#34)) ([3bf1384](3bf1384))
* rename stop identify function ([#31](#31)) ([d97e931](d97e931))
* screen view tracking ([#108](#108)) ([f836b9a](f836b9a))
* track events type in HTTP requests ([#117](#117)) ([745d4ad](745d4ad))

### Features

* add [String:Any] support to identify & track ([#94](#94)) ([5a220c4](5a220c4))
* add screen view tracking ([#82](#82)) ([c2034a6](c2034a6))
* automatic push events ([#63](#63)) ([cf81b23](cf81b23))
* create background queue  ([#99](#99)) ([80fffb8](80fffb8))
* create mocks for push messaging ([#35](#35)) ([b2c5d62](b2c5d62))
* event tracking ([#42](#42)) ([be768bb](be768bb))
* identify customer ([#27](#27)) ([f79d1c9](f79d1c9))
* make US default region ([#28](#28)) ([1d10a8f](1d10a8f))
* register device token with FCM ([#46](#46)) ([f6a87e0](f6a87e0))
* register/delete device tokens ([#26](#26)) ([d0ddc07](d0ddc07))
* rich push deep links ([#45](#45)) ([fe21cc8](fe21cc8))
* rich push images ([#59](#59)) ([03fc284](03fc284))
* save all siteids registered with SDK ([#30](#30)) ([95db6dc](95db6dc))
* subsequent identifies without passing identifier ([#96](#96)) ([47d9166](47d9166))
* track push events ([#47](#47)) ([a37e60e](a37e60e))
@ami-ci
Copy link
Contributor

ami-ci commented Jan 19, 2022

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Background queue not running on 30 second timer as intended.
4 participants