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

notifs: Live-update state of whether realm has enabled notifications #5807

Merged

Conversation

chrisbobbe
Copy link
Contributor

This PR is stacked on top of my current revision for #5806.

Fixes: #5805

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this! Two nits below, and I made some comments on the base PR #5806. Otherwise this is ready to merge once #5806 is in.

Comment on lines 288 to 289
if (data.push_notifications_enabled !== undefined) {
result.pushNotificationsEnabled = data.push_notifications_enabled;
Copy link
Member

Choose a reason for hiding this comment

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

nit: let's put these in the same order as the properties appear in the REGISTER_COMPLETE case above — that helps make it easy to compare the two and spot any gaps or discrepancies

Copy link
Member

Choose a reason for hiding this comment

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

Doing that review now:

  • There's what at first glance looks like a gap that state.webPublicStreamsEnabled doesn't get updated. But the story is that that's a server setting and there's no event to update it.
  • That's it! Otherwise everything lines up.

I'll push a quick commit on top of the PR branch that makes explicit what's happening there. Then it should probably go before the main commit here.

Comment on lines 153 to 155
}
case EventTypes.realm: {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
}
case EventTypes.realm: {
}
case EventTypes.realm: {

and also between the end of this case and the default case

(Arguably there should have been a blank line already separating the existing case from the default case. But perhaps it didn't seem as needed when there was just one non-default case.)

@chrisbobbe chrisbobbe force-pushed the pr-live-update-push-notifications-enabled branch from a47d5ff to c46625f Compare December 27, 2023 20:04
@chrisbobbe
Copy link
Contributor Author

Thanks for the review! Revision pushed, and I plan to merge this once #5806 is in, as requested.

gnprice and others added 4 commits January 3, 2024 17:04
Making sure that when the realm goes from disabling to enabling
notifications, we clear out the state of whether the user has
dismissed the banner on the home screen -- just like we do when the
/register response informs us of this change. That's so that if
notifications become disabled again, a new banner will be shown.

Fixes: zulip#5805
@chrisbobbe chrisbobbe force-pushed the pr-live-update-push-notifications-enabled branch from c46625f to cbdf900 Compare January 4, 2024 01:08
@chrisbobbe chrisbobbe merged commit cbdf900 into zulip:main Jan 4, 2024
1 check passed
@chrisbobbe
Copy link
Contributor Author

Done.

@chrisbobbe chrisbobbe deleted the pr-live-update-push-notifications-enabled branch January 4, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live-update push_notifications_enabled, newly included in realm update events
2 participants