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: when queue cannot find task, expect queue runs next task #397

Merged
merged 1 commit into from Oct 27, 2023

Conversation

levibostian
Copy link
Member

@levibostian levibostian commented Oct 26, 2023

Through reviewing a set of SDK debug logs recently, I noticed the queue can get into an edge case that prevents it from ever finishing. Blocking the queue from running any more tasks while the app is in memory.

I was able to reproduce the issue through a test and then implemented a bug fix.

@github-actions
Copy link

github-actions bot commented Oct 26, 2023

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: levi/fix-queue-quit-early (1698347601)
  • CocoaPods-FCM: levi/fix-queue-quit-early (1698347644)

@levibostian levibostian requested a review from a team October 26, 2023 19:14
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #397 (b5ad08a) into main (9dad7f3) will increase coverage by 3.05%.
Report is 129 commits behind head on main.
The diff coverage is 33.60%.

@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
+ Coverage   56.11%   59.16%   +3.05%     
==========================================
  Files         103      119      +16     
  Lines        1153     4602    +3449     
==========================================
+ Hits          647     2723    +2076     
- Misses        506     1879    +1373     
Files Coverage Δ
...s/Common/Background Queue/ApiSyncQueueRunner.swift 86.11% <ø> (+2.77%) ⬆️
...ces/Common/Background Queue/QueueQueryRunner.swift 100.00% <100.00%> (ø)
.../Common/Background Queue/QueueRequestManager.swift 100.00% <100.00%> (ø)
...rces/Common/Background Queue/QueueRunRequest.swift 100.00% <100.00%> (+10.00%) ⬆️
...ask Data/DeletePushNotificationQueueTaskData.swift 100.00% <100.00%> (ø)
...Queue/Task Data/IdentifyProfileQueueTaskData.swift 100.00% <100.00%> (ø)
...k Data/RegisterPushNotificationQueueTaskData.swift 100.00% <100.00%> (ø)
...ound Queue/Task Data/TrackEventQueueTaskData.swift 100.00% <100.00%> (ø)
...ces/Common/Background Queue/Type/QueueStatus.swift 100.00% <ø> (ø)
...urces/Common/Background Queue/Type/QueueTask.swift 100.00% <ø> (ø)
... and 81 more

... and 45 files with indirect coverage changes

@@ -95,7 +95,7 @@ public class CioQueueRunRequest: QueueRunRequest {

// The task failed to execute like a HTTP failure. Update `lastFailedTask`.
updateWhileLoopLogicVariables(didTaskFail: true, taskJustExecuted: nextTaskToRunInventoryItem)
break
continue // quit loop early and move to next task.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this possibly fix the bug that the customer reported ?

@levibostian levibostian merged commit 01ea7a6 into main Oct 27, 2023
11 checks passed
@levibostian levibostian deleted the levi/fix-queue-quit-early branch October 27, 2023 16:15
github-actions bot pushed a commit that referenced this pull request Oct 27, 2023
## [2.8.5](2.8.4...2.8.5) (2023-10-27)

### Bug Fixes

* when queue cannot find task, expect queue runs next task ([#397](#397)) ([01ea7a6](01ea7a6))
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