Skip to content

Conversation

@jinliu9508
Copy link
Contributor

@jinliu9508 jinliu9508 commented Dec 19, 2025

Description

One Line Summary

Fix NOT_EQUAL_TO IAM triggers incorrectly evaluating to true when the trigger key does not exist.

Details

Motivation

There is a bug where any In-App Message trigger using the NOT_EQUAL_TO operator (e.g., "soup" IS NOT "pea") evaluates to true even when the trigger key ("soup") has never been set. This results in IAMs showing immediately on app startup even when no relevant trigger data is present.

Scope

This fix only affects the logic for evaluating IAM triggers when the trigger key is missing.
Other trigger operators (EXISTS, NOT_EXISTS, EQUAL_TO, numeric operators, dynamic triggers) are unaffected.

OPTIONAL - Other

The logic now aligns with user expectations and internal trigger design semantics.
This avoids IAMs unintentionally firing at session start and ensures consistent evaluation when triggers are present or absent.

Testing

Unit testing

Added unit tests for TriggerController. A few test cases are specifically testing the NOT_EQUAL_TO semantics.

Manual testing

Tested with Emulator Pixel 9 API 35.
Step to reproduce:

  1. Create an IAM with a trigger "soup" NOT EQUAL TO "pea"
  2. Open the app, observe that the IAM shows up even no trigger has been added.
    After fix, the IAM only shows up when a trigger with key "soup" and value being anything different than "pea" is added.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

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.

2 participants