-
Notifications
You must be signed in to change notification settings - Fork 109
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
Push provider switch #2873
Push provider switch #2873
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor remarks, otherwise LGTM
@@ -78,6 +147,9 @@ class AdvancedSettingsPresenter @Inject constructor( | |||
isSharePresenceEnabled = isSharePresenceEnabled, | |||
theme = theme, | |||
showChangeThemeDialog = showChangeThemeDialog, | |||
pushDistributor = currentDistributorName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename currentPushDistributor
to be clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -78,6 +147,9 @@ class AdvancedSettingsPresenter @Inject constructor( | |||
isSharePresenceEnabled = isSharePresenceEnabled, | |||
theme = theme, | |||
showChangeThemeDialog = showChangeThemeDialog, | |||
pushDistributor = currentDistributorName, | |||
pushDistributors = distributorNames.toImmutableList(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
availablePushDistributors
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// List of PushProvider -> Distributor | ||
var distributors by remember { mutableStateOf<List<Pair<PushProvider, Distributor>>>(emptyList()) } | ||
var distributorNames by remember { mutableStateOf<List<String>>(emptyList()) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use derivedStateOf
instead of changing both field in the LaunchedEffect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, both calls are sync and initialized once so I don't see why we need to make these values mutable states, just calculating them inside the remember for distributors
one and derivedStateOf
for distributorNames
should be simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks. 97aa57b should be OK, just initialize data in remember
(no need to use derivedStateOf
). OK for you both?
Is there a specific reason to add the toggle to the "Advanced Settings" menu and not the "Notifications" menu? The latter would make more sense to me |
We discussed internally about it, and concluded that this feature is quite an advanced feature and we do not want to confuse users when they want to change their notification settings. |
d73ae65
to
06d80ee
Compare
Quality Gate passedIssues Measures |
Type of change
Content
Add an advanced setting entry to switch between available push providers: Firebase, and available UnifiedPush distributors.
Also properly unregister existing pushers and update the codebase for everything to work as expected.
Please note that matrix.org user may have issue getting push from UnifiedPush since there is some rate limiting. This will be handled separately.
Motivation and context
Screenshots / GIFs
Tests
ntfy
.Tested devices
Checklist