Skip to content

Added automatic push distributor selection#1774

Open
ArnyminerZ wants to merge 7 commits intomainfrom
1737-enable-push-by-default
Open

Added automatic push distributor selection#1774
ArnyminerZ wants to merge 7 commits intomainfrom
1737-enable-push-by-default

Conversation

@ArnyminerZ
Copy link
Member

Purpose

See #1737, but basically, Push is basically stable enough to at least select a distributor by default.

In any case, if one doesn't trust it, the server admin should simply not install support for push on the server, and the distributor will be unused.

Short description

  • Added automatic push distributor selection
    • Added a new injectable class called DistributorPreferences. It contains a list of package names which will define what the preference for each distributor is.
    • For OSE, no distributor has preference.
    • For Play Store builds we might want to pre-select FCM for example, or for managed. This can be set with the DistributorPreferences implementation.
  • Added a new settings entry which will be set to true whenever the user manually disables push (because it will be enabled by default). If this setting is true, no push distributor will be automatically selected.

We still have to add the individual implementations for each flavor on bitfireAt/davx5.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@ArnyminerZ ArnyminerZ self-assigned this Oct 25, 2025
@ArnyminerZ ArnyminerZ requested a review from a team as a code owner October 25, 2025 10:58
@ArnyminerZ ArnyminerZ added pr-feature Implements a new feature or functionality (only for PRs) push related to WebDAV-Push labels Oct 25, 2025
@ArnyminerZ ArnyminerZ linked an issue Oct 25, 2025 that may be closed by this pull request
@sunkup sunkup force-pushed the 1737-enable-push-by-default branch from adfee4b to 09f359d Compare November 20, 2025 10:58
@sunkup
Copy link
Member

sunkup commented Nov 20, 2025

I will change to draft for now and we can reopen when we want to merge it - that is when we know in which version it will be added.

@sunkup sunkup marked this pull request as draft November 20, 2025 11:18
@rfc2822 rfc2822 force-pushed the 1737-enable-push-by-default branch from d4c00a0 to 6e0cde7 Compare December 11, 2025 14:33
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

I think it will finally be time 😄

As I understand it, the basic idea is to check/update the push distributor whenever the PushRegistrationWorker is run, instead of setting it explicitly from the UI.

This sounds good to me! However some notes.

(Also please fix conflicts)

Comment on lines 117 to 136
Copy link
Member

Choose a reason for hiding this comment

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

I think this code should go to a seperate PushDistributorManager, because it's not related to the task of updating the subscriptions.

One class should only do one thing:

  • PushDistributorManager → manage push distributor
  • PushRegistrationManager → manage actual subscriptions

The same applies to the existing PushRegistrationManager.setPushDistributor(), which should also be moved to PushDistributorManager.


Then the PushRegistrationWorker could

  1. pushDistributorManager.update() → make sure distributor is correct and set up,
  2. pushRegistrationManager.update() → update subscriptions with selected push distributor.

# Conflicts:
#	app/src/ose/kotlin/at/bitfire/davdroid/di/OseFlavorModule.kt
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
@ArnyminerZ
Copy link
Member Author

ArnyminerZ commented Jan 29, 2026

As agreed on the meeting, FCM pre-selection for gplay variant is kept. So this should be ready for now. We can keep it improving later (actual distributor pinging to make sure it's available)

Note: The gplay preference should be established on the private repo

@ArnyminerZ ArnyminerZ marked this pull request as ready for review January 29, 2026 12:01
@ArnyminerZ ArnyminerZ requested a review from rfc2822 February 2, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Implements a new feature or functionality (only for PRs) push related to WebDAV-Push

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Push by default

3 participants

Comments