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

Unsubscribe push from unsynced collections #1011

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Sep 9, 2024

Purpose

Adds functionality: when collections are

  1. registered for Push and then
  2. unselected (and thus not syncable anymore),

they shall be unregistered from the server.

Short description

PushRegistrationWorker scans for collections that are registered for Push, but not selected for synchronization, and unregisters them from Push.

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.

@rfc2822 rfc2822 added the enhancement New feature or request label Sep 9, 2024
@rfc2822 rfc2822 self-assigned this Sep 9, 2024
@rfc2822 rfc2822 linked an issue Sep 9, 2024 that may be closed by this pull request
@rfc2822 rfc2822 force-pushed the 1010-push-unregister-unneeded-subscriptions branch from 2b60d1e to a56b0f4 Compare September 9, 2024 12:37
@rfc2822 rfc2822 marked this pull request as ready for review September 9, 2024 12:37
@rfc2822 rfc2822 requested a review from sunkup September 9, 2024 12:56
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

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

Why do we register all collections every time? We should be able to exclude already registered collections from being registered again.

Also I take it some of the code in the worker will be extracted to dav4jvm later?

Looks good otherwise 👍

@rfc2822
Copy link
Member Author

rfc2822 commented Sep 10, 2024

Why do we register all collections every time? We should be able to exclude already registered collections from being registered again.

The logic for re-registering before expiration is not yet implemented, so we have to re-register it every time. Also, the worker is not run regularly yet. This is also related.

Also I take it some of the code in the worker will be extracted to dav4jvm later?

I don't know whether it's necessary. We already use the POST/DELETE method from dav4jvm, and generating the message bodies is usually not done in dav4jvm. Let's have a look when it's (almost) finished.

Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

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

Fair, sounds good to me.

@rfc2822 rfc2822 merged commit 0b9d4cd into main-ose Sep 10, 2024
12 checks passed
@rfc2822 rfc2822 deleted the 1010-push-unregister-unneeded-subscriptions branch September 10, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push: unregister unneeded subscriptions
2 participants