Skip to content

hotfix/cp-11582-visiolink-push-banner-is-not-being-desplay#355

Merged
snuricp merged 4 commits into
masterfrom
hotfix/cp-11582-visiolink-push-banner-is-not-being-desplay
Jun 11, 2026
Merged

hotfix/cp-11582-visiolink-push-banner-is-not-being-desplay#355
snuricp merged 4 commits into
masterfrom
hotfix/cp-11582-visiolink-push-banner-is-not-being-desplay

Conversation

@unnaticleverpush

@unnaticleverpush unnaticleverpush commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fix app banners not appearing when a banner-carrying push is tapped from the background


Note

Medium Risk
Touches core app-banner lifecycle, activity callbacks, and concurrent network loading paths used on every notification open; behavior changes are intentional but broad across the SDK.

Overview
Fixes push-triggered app banners not showing when a notification is opened from the background (CP-11582).

Activity readiness: Adds isValidHostActivity() so ActivityInitializedListener callbacks run only on a real host activity—not on finishing/destroyed activities or the short-lived NotificationOpenedActivity trampoline (except when using the notification-opened callback mode). showBannerById now waits on that listener before presenting UI.

Banner loading: Replaces a single loading flag with separate default vs notification loads, a request queue (PendingBannerRequest), and processNextBannerRequest() so concurrent fetches serialize cleanly; after a notification fetch, default banners load automatically if they were skipped. Notification getBanners listeners are tracked separately from default listeners.

Resilience: Session init and banner APIs fall back to channel ID from prefs when missing; silent push banners are shown on short sessions and iterated safely. AppBannerPopup caps show retries (50 × 100ms) with a safe main looper. Unsubscribe clears SUBSCRIPTION_PIANO_SEGMENTS from prefs.

Reviewed by Cursor Bugbot for commit f29d74e. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes push app banners not showing when a banner-carrying notification is opened from the background. Addresses CP-11582 by delaying banner UI until a valid host activity is ready and by serializing banner loads with separate default/notification paths.

  • Bug Fixes
    • Only fire activity-initialized callbacks when a valid host is resumed; treat NotificationOpenedActivity as valid only in callback mode and ignore finishing/destroyed activities.
    • Serialize banner fetches via a request queue with separate default vs notification loading flags; auto-load default banners after a notification fetch if not yet loaded.
    • Split listeners for default vs notification banners; notify and clear only the relevant set.
    • Resolve and validate channel ID (prefs fallback) before session init, loads, and banner events; short sessions still flush stored silent push banners.
    • Show stored silent push banners safely after loads; iterate defensively and remove entries as they are shown.
    • Make display safer: showBannerById waits for activity readiness; AppBannerPopup uses a safe main looper and caps show retries (50x/100ms).
    • Clear SUBSCRIPTION_PIANO_SEGMENTS on unsubscribe.

Written for commit f29d74e. Summary will update on new commits.

Review in cubic

Fix app banners not appearing when a banner-carrying push is tapped from
the background
@unnaticleverpush unnaticleverpush self-assigned this Jun 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java
Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java
Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java
Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f29d74e. Configure here.

}

if (isChannelIdInvalid(channelId, "loadBanners"))
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid channel stalls banner queue

Medium Severity

When processNextBannerRequest dequeues work and loadBanners exits early because the channel ID is still invalid after resolution, nothing invokes processNextBannerRequest again. Remaining entries in pendingBannerRequests are never run and later banner loads can stop processing.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f29d74e. Configure here.

} else {
defaultBannersLoaded = false;
setLoadingDefaultBanners(false);
processNextBannerRequest(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed default load never retried

Medium Severity

After a notification banner fetch finishes, the module may auto-start a default banner fetch. If that default request fails, processNextBannerRequest(false) drains the queue but does not schedule another default load, even when defaultBannersLoaded is false. Session default banners can stay unloaded until a full restart of banner initialization.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f29d74e. Configure here.

} else {
if (isLoadingDefaultBanners()) {
isBannerRequestRunning = false;
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate load drops queued request

Medium Severity

If loadBanners is started from the queue while a default or notification fetch is already marked loading, it clears isBannerRequestRunning and returns without re-queuing the work or calling processNextBannerRequest. That dequeued PendingBannerRequest is discarded.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f29d74e. Configure here.

@snuricp snuricp merged commit 270586c into master Jun 11, 2026
4 of 6 checks passed
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