Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSO JITM appears in Calypso Sidebar #14547

Closed
gwwar opened this issue Jan 31, 2020 · 6 comments · Fixed by #14622
Closed

SSO JITM appears in Calypso Sidebar #14547

gwwar opened this issue Jan 31, 2020 · 6 comments · Fixed by #14622
Assignees
Labels
[Feature] JITM Just In Time Messages - pop-up tips and suggestions that appear on the dashboard and sidebar. [Type] Bug When a feature is broken and / or not performing as intended
Milestone

Comments

@gwwar
Copy link
Contributor

gwwar commented Jan 31, 2020

It looks like an SSO JITM is showing up in the sidebar, probably unintentionally. This was originally found and reported by @rickybanister

I believe this one is registered at

private function prepare_sso_first_login_jitm() {

Screen Shot 2020-01-31 at 2 16 51 PM

But appears in two API responses on the calypso:stats-day:admin-notices and calypso:stats:sidebar_notice. For the amount of content here the API should not be returning this.

Screen Shot 2020-01-31 at 2 18 31 PM

Screen Shot 2020-01-31 at 2 17 26 PM

We do have an A/B test running for sidebar banners, but this is unrelated since I see the same behavior in Calypso master at 9820c2fa70292fda1db438deca943ce1b29f0faa before the PR was merged.

@Automattic/manage is happy to help review any PRs if folks have a fix.

To Reproduce This:

Screen Shot 2020-01-31 at 1 43 35 PM

  • Visit WordPress.com/stats/day/siteslug

Expected: Banner appears in Stats
Actual: Banner appears in Stats and in Sidebar

@gwwar gwwar added [Type] Bug When a feature is broken and / or not performing as intended [Feature] JITM Just In Time Messages - pop-up tips and suggestions that appear on the dashboard and sidebar. labels Jan 31, 2020
@gwwar
Copy link
Contributor Author

gwwar commented Jan 31, 2020

cc @jeherve we're also happy to help fix this one if folks guide us a bit in code. I suspect we have a regex here that's too inclusive.

@jeherve
Copy link
Member

jeherve commented Feb 3, 2020

Nice catch!

This one is a bit of a custom JITM, it doesn't work the same way as the other messages. We force-inject it to the list of messages you should get when you first log in to your site after enabling SSO.

That makes fixing things a bit more complicated. To be honest I don't think it makes sense for this message to appear at all in Calypso.

Do you happen to know if there would be a way to remove a specific JITM right in Calypso?

@gwwar
Copy link
Contributor Author

gwwar commented Feb 4, 2020

@jeherve Is there no clean way of modifying the API response from v4/jitm?

One sanity check might be that anything added to the calypso:*:sidebar_notice path should use a template of sidebar. Depending on how difficult it is, we can try to do this this on the server (preferable) or ignore this in Calypso on the slot.

@jeherve jeherve self-assigned this Feb 10, 2020
@jeherve jeherve added this to the 8.3 milestone Feb 10, 2020
jeherve added a commit that referenced this issue Feb 10, 2020
@jeherve
Copy link
Member

jeherve commented Feb 10, 2020

Is there no clean way of modifying the API response from v4/jitm?

Yes, that would seem to be the best way. #14622 should take care of that, hopefully.

@gwwar
Copy link
Contributor Author

gwwar commented Feb 10, 2020

Thanks @jeherve I've added 14622 to our review list!

@gwwar
Copy link
Contributor Author

gwwar commented Feb 11, 2020

cc @rickybanister, thanks to @jeherve this one should be fixed in the 8.3 release

kraftbj added a commit that referenced this issue Feb 13, 2020
* JITM: pass extra parameter to filter used to customize messages

* SSO: do not display JITM when not in wp-admin

Fixes #14547

* Use strict comparison

* Set default parameter for new argument

Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] JITM Just In Time Messages - pop-up tips and suggestions that appear on the dashboard and sidebar. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants