Fix Braze banner reentry and dismissal, integrate Braze banners into Feast contextual nudges#16415
Open
juabara wants to merge 2 commits into
Open
Fix Braze banner reentry and dismissal, integrate Braze banners into Feast contextual nudges#16415juabara wants to merge 2 commits into
juabara wants to merge 2 commits into
Conversation
…Feast nudges - Guard against double-dismissal with hasDismissedRef; call braze.dismissBanner() on close so the SDK suppresses the banner natively - Track stale placements to prevent rendering cached banners after a failed or timed-out refresh; late successes mark placements fresh again - Only request placements that exist on the page via getPagePlacements() - Invert postMessage origin check for early return on invalid origins - Add GET_CONTEXT message type for banner creatives to read page context - Integrate BrazeBannersSystemDisplay into FeastContextualNudge with fallback - Assign up to 5 evenly distributed nudge indices in ArticleRenderer - Bump @braze/web-sdk from 6.5.0 to 6.9.0 - Add unit tests for all changes
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two issues with the Braze Banners System and integrates it into Feast contextual nudges.
Banner dismissal fix
hasDismissedRefguard to prevent double-dismissal via rapid clicks or duplicatepostMessageeventsbraze.dismissBanner(banner)on close so the SDK natively suppresses the banner for the userpostMessageorigin check to early-return on invalid origins (clearer and safer)BRAZE_BANNERS_SYSTEM:GET_CONTEXTmessage type so banner creatives can read page contextBanner reentry / stale placement fix
Set— failed or timed-out refreshes mark placements stale, preventing cached banners from renderingFeast contextual nudge integration
FeastContextualNudgenow checks for a Braze banner at the nudge's placement and renders it via BrazeBannersSystemDisplay if available, falling back to the existing Feast nudgeArticleRendererassigns up to 5 evenly distributed nudge indices across recipe sections viagetFeastNudgeIndexOther
@braze/web-sdkfrom 6.5.0 to 6.9.0GET_CONTEXTdocumentation