Skip to content

AB#292767 fix: stopDispatchTimer starting the timer when called off the main thread - #144

Open
eligutovsky wants to merge 2 commits into
masterfrom
fix/stop-dispatch-timer
Open

AB#292767 fix: stopDispatchTimer starting the timer when called off the main thread#144
eligutovsky wants to merge 2 commits into
masterfrom
fix/stop-dispatch-timer

Conversation

@eligutovsky

Copy link
Copy Markdown
Member

Description of Changes

OptiTrack.stopDispatchTimer() called startDispatchTimer() when invoked off the main
thread, so every off-main stop started the dispatch timer instead of stopping it.

     func stopDispatchTimer() {
         guard Thread.isMainThread else {
             DispatchQueue.main.sync {
-                self.startDispatchTimer()
+                self.stopDispatchTimer()
             }
             return
         }

This is a cherry-pick of 10aabcc1 (Christopher Wyllie, 2022-04-29) from the
fix-dispatch-timer branch, which was never merged. Original authorship is preserved.
The branch it sat on is 208 commits behind master; the single-line change cherry-picks
cleanly onto current master.

Second commit bumps the patch version to 6.8.1.

Breaking Changes

  • None

Release Checklist

Prepare:

  • Detail any breaking changes. Breaking changes require a new major version number — none; patch release
  • Check pod lib lint passes
  • Update any relevant sections of the repository wiki pages on a branch — n/a, no public API change

Bump versions in:

  • OptimoveCore.podspec

  • OptimoveNotificationServiceExtension.podspec

  • OptimoveSDK.podspec

  • OptimoveCore/Sources/Classes/Constants/SDKVersion.swift

  • README.md — n/a, contains no version reference

  • CHANGELOG.md

  • Update major version numbers in wiki (basic integration + push guides) — n/a, patch release

Integration tests

Unit tests run locally on the UnitTests scheme (iPhone 15, iOS 17.5): 75 tests,
0 failures
. Manual integration checklist below not exercised — the change is confined
to timer invalidation on the event-dispatch path.

T&T Only

  • Init SDK with only T&T credentials
  • Associate customer
  • Associate email
  • Track events

Mobile Only

  • Init SDK with all credentials
  • Track events
  • Associate customer (verify both backends)
  • Register for push
  • Opt-in for In-App
  • Send test push
  • Send test In-App
  • Receive / trigger deep link handler (In-App/Push)
  • Receive / trigger the content extension, render image and action buttons for push
  • Verify push opened handler

Deferred Deep Links

  • With app installed, trigger deep link handler
  • With app uninstalled, follow deep link, install test bundle, verify deep link read from Clipboard, trigger deep link handler

Combined

  • Track event for T&T, verify push received
  • Trigger scheduled campaign, verify push received
  • Trigger scheduled campaign, verify In-App received

Release:

  • Squash and merge to master
  • Delete branch once merged
  • Create tag from master matching chosen version
  • Run pod trunk push to publish to CocoaPods

Post Release:

  • Push wiki pages to master

Copilot AI review requested due to automatic review settings August 5, 2026 03:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a threading bug in the OptiTrack dispatch-timer shutdown path: calling stopDispatchTimer() off the main thread previously routed to startDispatchTimer(), unintentionally starting the timer instead of stopping it. It also bumps the SDK patch version to 6.8.1 and records the fix in the changelog.

Changes:

  • Fix OptiTrack.stopDispatchTimer() to correctly stop the timer when invoked off the main thread by re-dispatching to main and calling stopDispatchTimer() (not startDispatchTimer()).
  • Bump CocoaPods spec versions and SDKVersion to 6.8.1.
  • Add a 6.8.1 changelog entry describing the fix.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
OptimoveSDK/Sources/Classes/Components/OptiTrack/OptiTrack.swift Fixes off-main-thread timer stop logic to prevent accidentally starting the dispatch timer.
OptimoveSDK.podspec Bumps OptimoveSDK pod version to 6.8.1.
OptimoveNotificationServiceExtension.podspec Bumps Notification Service Extension pod version to 6.8.1.
OptimoveCore/Sources/Classes/Constants/SDKVersion.swift Updates SDKVersion constant to 6.8.1.
OptimoveCore.podspec Bumps OptimoveCore pod version to 6.8.1.
CHANGELOG.md Adds 6.8.1 entry documenting the timer-stop fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eligutovsky eligutovsky changed the title fix: stopDispatchTimer starting the timer when called off the main thread AB#292767 fix: stopDispatchTimer starting the timer when called off the main thread Aug 5, 2026
eligutovsky added a commit that referenced this pull request Aug 5, 2026
6.8.1 is already claimed by the pending stopDispatchTimer fix (PR #144), so this
takes the next patch number rather than colliding with it in the changelog.
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.

3 participants