Skip to content

Conversation

@vbabenkoru
Copy link
Contributor

@vbabenkoru vbabenkoru commented Oct 22, 2021

🔹 Jira Ticket(s) if any

✏️ Description

Without it, if the hashCodes matches a button from one of the previous notifications, the pending intent won't be updated, and it may perform an action from the old message.

The root of the issue is that we generate PendingIntents with a requestCode that is not guaranteed to be unique per message. As a result, if requestCode collides with a pendingIntent created by an older message (potentially from another template entirely), it will reuse the PendingIntent from the old notification. Adding PendingIntent.FLAG_UPDATE_CURRENT should make it update the PendingIntent if requestCodes collide.

Without it, if the hashCodes matches a button from one of the previous notifications, the pending intent won't be updated, and it may perform an action from the old message.
@vbabenkoru vbabenkoru requested a review from Ayyanchira October 22, 2021 04:57
@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #390 (56e3af7) into master (7775b92) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #390   +/-   ##
=======================================
  Coverage   67.53%   67.53%           
=======================================
  Files          61       61           
  Lines        3782     3782           
  Branches      440      440           
=======================================
  Hits         2554     2554           
  Misses        966      966           
  Partials      262      262           
Impacted Files Coverage Δ
...rable/iterableapi/IterableNotificationBuilder.java 81.25% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7775b92...56e3af7. Read the comment docs.

@vbabenkoru vbabenkoru merged commit c7edf27 into master Oct 22, 2021
@vbabenkoru vbabenkoru deleted the bugfix/MOB-3588-action-buttons-updatable branch October 22, 2021 19:09
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