Skip to content

Release FIAM display gate after invalid card construction - #16819

Merged
ncooke3 merged 5 commits into
firebase:mainfrom
dajiaohuang:fix/fiam-nil-display-gate
Oct 14, 2026
Merged

ncooke3 merged 5 commits into
firebase:mainfrom
dajiaohuang:fix/fiam-nil-display-gate

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16817.

A card message without image data cannot be constructed. Previously that return left isMsgBeingDisplayed set, so later checks stopped before selecting another message.

Release the display gate and remove the unconstructable message from the cache, allowing a later foreground check after the normal display interval to display the following valid message. The regression queues a card with no images before a valid message and exercises both checks. Its image-loader fixture returns data only for image URLs actually present; its mutable test clock advances the configured interval before checking the following message and also verifies cache removal.

This is the independent nil-construction fix requested in the review of #16763; callback synchronization remains in that PR. No public API changes.

Validation:

  • clang-format 23.1.2 and git diff --check pass.
  • Actual Xcode 26.4.1/iOS simulator XCTest comparison uses the PR's test fixture and changes only the executor source. Main source 8d7687f fails testCardWithoutImageDoesNotBlockNextMessage with three assertions: invalid card remains cached and the next valid message never displays.
  • Restoring exact PR source c013cfd passes all 30 FIRIAMDisplayExecutorTests with zero failures, including that regression: native before/after XCTest.
  • This establishes actual executor unit behavior; full backend/device integration remains separate.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@paulb777

paulb777 commented Oct 2, 2026

Copy link
Copy Markdown
Member

[paulb777-bot] Thanks for splitting this out. This fixes #16817. We had independently confirmed on main that resetting isMsgBeingDisplayed on this path unblocks later messages, using a regression test with a card whose portrait image URL is nil (what the fetch response parser produces for a missing or rejected URL). Could you add Fixes #16817 to the description?

@paulb777

paulb777 commented Oct 2, 2026

Copy link
Copy Markdown
Member

Please address the failing tests

@paulb777 paulb777 added the api: inappmessaging Firebase In App Messaging label Oct 2, 2026
@dajiaohuang

Copy link
Copy Markdown
Contributor Author

The CI failure is caused by the test using timestamp 1000 for both checks: the first construction attempt advances lastDisplayTime, so the second check is rejected by the normal one-minute display interval before exercising the gate.

Updated the clock stub to a mutable timestamp, advanced it by the configured display interval before the second check, and asserted that the unusable card was removed from the cache. Production behavior and the display interval remain unchanged. The original gate bug still prevents the second display even after the interval.

clang-format 23.1.2 and git diff --check pass. Apple XCTest is unavailable locally; the updated native CI result is pending.

@dajiaohuang

Copy link
Copy Markdown
Contributor Author

Confirmed the revised test with an actual Apple XCTest before/after run. Using main executor 8d7687f with the PR's corrected fixture, testCardWithoutImageDoesNotBlockNextMessage fails three assertions: the invalid card is still cached and the following valid message cannot display. Restoring exact PR source c013cfd passes all 30 FIRIAMDisplayExecutorTests, zero failures: native XCTest results. The test advances the ordinary display interval and verifies cache removal; callback synchronization remains independently scoped to #16763.

@paulb777 paulb777 added this to the 13.1.0 - M188 milestone Oct 3, 2026
Comment thread FirebaseInAppMessaging/CHANGELOG.md Outdated
Comment thread FirebaseInAppMessaging/CHANGELOG.md Outdated
@ncooke3

ncooke3 commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks!

@ncooke3
ncooke3 merged commit 4c8f352 into firebase:main Oct 14, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: inappmessaging Firebase In App Messaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In-App Messaging can remain stuck after display message construction fails

3 participants