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

[Bug]: prepareAndPresent stack.removeAll { $0.isApproximatelyEqual(to: message) } throwing an error #109

Open
joaosouza-traxretail opened this issue Feb 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@joaosouza-traxretail
Copy link

Platform

iOS

Platform Version

17.2

Braze SDK Version

8.0.1

Xcode Version

15.2

Computer Processor

Apple (M1)

Repro Rate

100% of the time

Steps To Reproduce

Made a migration from Appboy ObjC SDK to Braze Swift SDK and started doing some testings. Found this one when sending an In-App Message test from the admin panel. The app sets a custom BrazeInAppMessageUIDelegate but only to be able to listen to events not to customize the UI.

Screenshot 2024-02-22 at 15 52 50

The custom delegate is set on AppDelegate as the documentation states:

Screenshot 2024-02-22 at 15 52 08

Screenshot 2024-02-22 at 15 47 18

Expected Behavior

In-App message to display normally.

Actual Incorrect Behavior

The app crashes.

Verbose Logs

#0	(null) in specialized MutableCollection._halfStablePartition(isSuffixElement:) ()
#1	0x0000000102dca290 in BrazeInAppMessageUI.prepareAndPresent(message:) at /Users/itsmejohndoe/Library/Developer/Xcode/DerivedData/Shopkick-adofaigyzwflmrcsnujvuddvxkpl/SourcePackages/checkouts/braze-swift-sdk/Sources/BrazeUI/InAppMessageUI/InAppMessageUI.swift:148
#2	0x0000000102dc9c64 in BrazeInAppMessageUI.present(message:) at /Users/itsmejohndoe/Library/Developer/Xcode/DerivedData/Shopkick-adofaigyzwflmrcsnujvuddvxkpl/SourcePackages/checkouts/braze-swift-sdk/Sources/BrazeUI/InAppMessageUI/InAppMessageUI.swift:107
#3	0x0000000102dc9f20 in BrazeInAppMessageUI.present(message:) at /Users/itsmejohndoe/Library/Developer/Xcode/DerivedData/Shopkick-adofaigyzwflmrcsnujvuddvxkpl/SourcePackages/checkouts/braze-swift-sdk/Sources/BrazeUI/InAppMessageUI/InAppMessageUI.swift:120
#4	(null) in @objc BrazeInAppMessageUI.present(message:) ()
#5	(null) in _OBJC_BrazeInAppMessagePresenterWrapper.present(message:) ()
#6	(null) in closure #1 in Publisher<>.presentNewMessages(using:) ()
#7	(null) in Subscriber.receive(_:) ()
#8	(null) in partial apply for closure #1 in Subject.send(_:) ()
#9	(null) in Sequence.forEach(_:) ()
#10	(null) in Subject.send(_:) ()
#11	(null) in partial apply for implicit closure #2 in implicit closure #1 in closure #2 in closure #1 in PublisherType.innerFlatMap<A, B>(maxPublishers:_:) ()
#12	(null) in Subscriber.receive(_:) ()
#13	(null) in partial apply for implicit closure #2 in implicit closure #1 in closure #1 in PublisherType<>.setFailureType<A>(to:) ()
#14	(null) in Subscriber.receive(_:) ()
#15	(null) in closure #1 in Just.init(_:) ()
#16	(null) in Publisher.subscribe(_:) ()
#17	(null) in protocol witness for PublisherType.subscribe(_:) in conformance Publisher<A, B> ()
#18	(null) in PublisherType.sink(name:receiveCompletion:receiveValue:) ()
#19	(null) in closure #1 in PublisherType<>.setFailureType<A>(to:) ()
#20	(null) in Publisher.subscribe(_:) ()
#21	(null) in protocol witness for PublisherType.subscribe(_:) in conformance Publisher<A, B> ()
#22	(null) in PublisherType.sink(name:receiveCompletion:receiveValue:) ()
#23	(null) in closure #2 in closure #1 in PublisherType.innerFlatMap<A, B>(maxPublishers:_:) ()
#24	(null) in partial apply for closure #2 in closure #1 in PublisherType.innerFlatMap<A, B>(maxPublishers:_:) ()
#25	(null) in Subscriber.receive(_:) ()
#26	(null) in partial apply for closure #1 in closure #2 in closure #1 in PublisherType.receive<A>(on:options:) ()
#27	(null) in thunk for @escaping @callee_guaranteed @Sendable () -> () ()
#28	(null) in _dispatch_call_block_and_release ()
#29	(null) in _dispatch_client_callout ()
#30	(null) in _dispatch_main_queue_drain ()
#31	(null) in _dispatch_main_queue_callback_4CF ()
#32	(null) in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#33	(null) in __CFRunLoopRun ()
#34	(null) in CFRunLoopRunSpecific ()
#35	(null) in GSEventRunModal ()
#36	(null) in -[UIApplication _run] ()
#37	(null) in UIApplicationMain ()
#38	0x000000010292fcf4 in main at /Users/itsmejohndoe/Development/TraxRetail/client_ios/Shopkick/main.m:12
#39	(null) in start ()

Additional Information

No response

@joaosouza-traxretail joaosouza-traxretail added the bug Something isn't working label Feb 22, 2024
@lowip
Copy link
Collaborator

lowip commented Feb 23, 2024

Hi @joaosouza-traxretail,

Thank you for opening this issue, we're tracking it internally and will update here once we have a fix ready. Are you able to reproduce the crash consistently?

Best,

@joaosouza-traxretail
Copy link
Author

HI @lowip

Thanks for answering! The crash happens 100% of times after receiving an In-App Message (the app crashes before showing it to the user).

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants