Skip to content

Fix legacy (no-wv) Feedback widget close on mobile#7693

Open
coskunaydinoglu wants to merge 1 commit into
masterfrom
fix-legacy-feedback-widget-mobile-close-signal
Open

Fix legacy (no-wv) Feedback widget close on mobile#7693
coskunaydinoglu wants to merge 1 commit into
masterfrom
fix-legacy-feedback-widget-mobile-close-signal

Conversation

@coskunaydinoglu

Copy link
Copy Markdown
Contributor

Fix: legacy Feedback widget close on mobile (Rating widget)

Problem

Legacy Rating widgets without a wv (widget version) parameter sent their close signal via postMessage even on mobile, and without the cly_widget_command identifier ({close: true} only). Mobile SDKs (Android/iOS) only intercept a real URL navigation, not postMessage, so tapping close on these legacy widgets did nothing on phones.

Fix

plugins/star-rating/frontend/public/templates/feedback-popup.html — in the no-wv branch of closeHandler, navigate on mobile like the modern (wv) widgets:

else {                       // legacy widget (no wv)
    if (platform !== 'Web') {
        window.location.href = 'https://countly_action_event?cly_widget_command=1&close=1';
    }
    else if (window.parent && typeof window.parent.postMessage === 'function') {
        var d = JSON.stringify({ close: true });   // unchanged legacy web behaviour
        window.parent.postMessage(d, parentOrigin);
    }
}

(platform !== 'Web' is used rather than the isWebSDK var, which is only declared inside the wv branch — using it here would hit a var-hoisting undefined and misfire on web.)

The web postMessage path is unchanged (legacy preservation); only the missing mobile navigation is added.

Notes

  • This is the CE/master copy of star-rating, which is what the enterprise build consumes via the core submodule; a parallel change is in countly-platform's own star-rating copy.
  • JS syntax check of the edited handler passes; a real Android/iOS smoke test of a legacy rating-widget close is recommended before release.
  • No Jira ticket provided; share the key and I'll rename branch/PRs.

https://claude.ai/code/session_015nUig7QXdAEYMhS16eSsu1


Generated by Claude Code

Legacy NPS and Rating widgets (those without a wv parameter) sent their close
signal via postMessage even on mobile, where the SDK only intercepts URL
navigation -- so the close button did nothing on Android/iOS. Make the no-wv
branch trigger a real navigation to
https://countly_action_event?cly_widget_command=1&close=1 on mobile, matching
the modern (wv) widgets, while preserving the existing web postMessage
behaviour for legacy widgets.

https://claude.ai/code/session_015nUig7QXdAEYMhS16eSsu1
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