Automattic / notifications-panel

Core notifications panel for WordPress.com notifications
0 stars 1 forks source link

Handle case where Jetpack users can be logged out of WP.com, but still load Notifications panel #244

Open beaulebens opened 6 years ago

beaulebens commented 6 years ago

I'm going to just reference this other issue: https://github.com/Automattic/jetpack/issues/682

And this Slack conversation: https://a8c.slack.com/archives/C02HLU2CH/p1522186251000449

Options mostly discussed have been:

kwight commented 6 years ago

We'd likely want to keep the initial behaviour of rendering the layout and spinner while fetching newest-note-data, but if that comes back a 403, replace the spinner with a message linking to https://wordpress.com/log-in in a new tab.

Another way to handle it might be to check higher up in Notifications for the wpcom.token prop, which I don't think would be present if the user is not authenticated. Then it could pass a isAuthenticated: false to Layout (eventually getting to NoteList).

dmsnell commented 6 years ago

I’d be in favor of checking higher up. If someone is logged out we can prevent them from having to download the entire bundle. This could easily belong in standalone entirely and do something creative like load HTML if logged out and only load React and the app when logged in.

dmsnell commented 6 years ago

Note that the bell and menu isn’t even part of this library. We can handle this entirely in the menu bar and cull the loading of the notifications iFrame when not logged in

kwight commented 6 years ago

That all sounds great @dmsnell , even better, will do 👍