Skip to content

feat: sdkTriggered should be passed as a value not a Binding#53

Closed
BrandonStalnaker wants to merge 1 commit into
mainfrom
feat/sdkTriggered-Binding-Fix
Closed

feat: sdkTriggered should be passed as a value not a Binding#53
BrandonStalnaker wants to merge 1 commit into
mainfrom
feat/sdkTriggered-Binding-Fix

Conversation

@BrandonStalnaker

Copy link
Copy Markdown
Collaborator

Summary

  • Clients saw a crash: EXC_BAD_ACCESS at 0x0 in SwiftUI’s LocationBox.get() when using RoktLayout with sdkTriggered: Binding. It happens when the host view that owns the https://github.com/State behind the binding is deallocated (e.g. navigation or tab switch) but RoktLayout is still in the tree and SwiftUI tries to read the binding during an update. The binding’s storage is then invalid and the read crashes. This can’t be handled in our code (it’s a process-level fault, not an exception), and there’s no way to check a binding’s validity before reading. The only way to avoid it is to stop holding a Binding in our view so SwiftUI never reads that storage.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Updated corresponding unit tests

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@BrandonStalnaker BrandonStalnaker self-assigned this Mar 17, 2026
@BrandonStalnaker BrandonStalnaker requested a review from a team as a code owner March 17, 2026 18:58
@BrandonStalnaker

Copy link
Copy Markdown
Collaborator Author

Closing in favor of fixing here ROKT/rokt-ux-helper-ios#211

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.

1 participant