Skip to content

Conversation

@mnaturel
Copy link
Contributor

@mnaturel mnaturel commented Nov 23, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

When background sync is used, on session start and each time we switch on background sync, account data event "org.matrix.msc3890.local_notification_settings." is updated.
When switching from background sync to regular push notifications method, any existing account data event is updated with empty content (API to delete an account data event is not available yet).

Also in this PR: renaming some notifications related use cases for consistency.

Motivation and context

Closes #7596

Screenshots / GIFs

Tests

Tests should be performed with both the GPlay and FDroid variant.

  • Install Ntfy app
  • Open the Network plugin in Flipper
  • Check the network call is correct after signin
  • Check the network call is correct when toggling the notifications for the current session in the settings
  • (Only FDroid) Check the network call is correct when switching from background sync mode to push notification method changing the related setting (Notifications -> Notifications method)

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 11

Checklist

@mnaturel mnaturel marked this pull request as ready for review November 23, 2022 14:35
@mnaturel mnaturel requested review from a team and ganfra and removed request for a team November 23, 2022 14:35
) {

suspend fun execute(session: Session) {
if (unifiedPushHelper.isBackgroundSync()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure this is the correct method to use to check if background sync is enabled. To be tested further to ensure it is working as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the implementation so that we can rely on this method.

@mnaturel
Copy link
Contributor Author

In order to have correct behavior, I need to first fix some bugs on the notification method selection process.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for all the tests.

@mnaturel mnaturel force-pushed the feature/mna/remote-notification-toggle-account-data branch from a9121cd to 54d0e84 Compare December 1, 2022 09:40
@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against 54d0e84

@mnaturel mnaturel force-pushed the feature/mna/remote-notification-toggle-account-data branch from 54d0e84 to 6c7ef69 Compare December 1, 2022 10:36
@mnaturel mnaturel changed the base branch from develop to fix/mna/unified-push-selection December 1, 2022 10:37
@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against 6c7ef69

@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against fe3675b

@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against 855c0bf

@mnaturel mnaturel requested a review from ganfra December 2, 2022 09:14
@mnaturel
Copy link
Contributor Author

mnaturel commented Dec 2, 2022

@ganfra Could you take a look again please? I had to change several things which were not working correctly. I have also rebased my work on this PR in which I refactored some logic for unifiedPush to fix several issues.

@mnaturel mnaturel force-pushed the fix/mna/unified-push-selection branch from b30dda7 to f8c59f6 Compare December 5, 2022 08:47
@mnaturel mnaturel force-pushed the feature/mna/remote-notification-toggle-account-data branch from 8d1b245 to 635f975 Compare December 5, 2022 08:47
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.3% 90.3% Coverage
0.0% 0.0% Duplication

Base automatically changed from fix/mna/unified-push-selection to develop December 5, 2022 15:58
@mnaturel mnaturel merged commit a12c640 into develop Dec 5, 2022
@mnaturel mnaturel deleted the feature/mna/remote-notification-toggle-account-data branch December 5, 2022 15:58
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.

Save m.local_notification_settings.<device-id> event in account_data

3 participants