braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: BrazeInAppMessageUI, incorrect deletion of messages from the stack #97

Closed alexeyshevel closed 9 months ago

alexeyshevel commented 11 months ago

Platform

iOS

Platform Version

iOS 17

Braze SDK Version

7.4.0

Xcode Version

15.1.0

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Example:

  1. Check file BrazeIn.AppMessageUI.
  2. The prepareAndPresent method in line 148 does not remove the message from the stack.

Expected Behavior

The prepareAndPresent method in file BrazeIn.AppMessageUI in line 148 must remove the message from the stack. In my case it works if I replace the code with this one: stack.removeAll { $0.data.id == message.data.id }

Actual Incorrect Behavior

The prepareAndPresent method in file BrazeIn.AppMessageUI in line 148 does not remove the message from the stack. stack.removeAll { $0 == message } There are probably issues in the Equatable protocol implementation for Braze.InAppMessage.

Verbose Logs

No response

Additional Information

No response

jerielng commented 10 months ago

Hey @alexeyshevel, this is on our radar, and it should be a reasonable fix to compare messages against the ID as you're describing. We don't happen to have any messages that can reproduce this--do you happen to have an example campaign or scenario where the message does not get removed?

Additionally, have you added any custom implementations around the in-app message itself, or are they all strictly the out-of-the-box implementations?

jacksonemiller commented 9 months ago

Hi there @alexeyshevel. We just released a fix for this in version 7.6.0 of the Swift SDK. I'm going to go ahead and close this thread for now, but feel free to re-open it or contact us if you have any other issues. Thanks again for the bug report.