Skip to content

Conversation

@Bungeefan
Copy link
Contributor

As discussed in #277:
While working on the feature, I discovered that it is impossible to cancel an already running job.
As you may know, the "Cancel" button currently just sets some properties which are checked only once inside the job (at the beginning).

This PR adds a repeated check (for importing_drive) inside the import job to be able to gracefully stop it even while already importing files:

  • Unfortunately, I had to purge the user preferences cache for each check (please advise if there is a better way, as this can be quite costly), otherwise the values were cached and therefore stale after the first check for the whole duration of the job.
    • This is also the reason for the experimental NCU namespace import, as the original (soon-to-be-deprecated?) IConfig provides no way to bypass or even purge its cache.
  • If the job is cancelled, it is now also removed from the JobList in case it is still in the queue.

Regarding the experimental NCU import for IUserConfig:
Can/should I still use the experimental import for the time being, or will it stop working immediately when updating to the newest release? Or should this PR even be delayed until the API is officially released as stable?

Note: This PR is in the draft status as it is based on a previous PR of mine (#285), which would have to be merged before this one, besides that, it's ready to be reviewed!

Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

Hi @Bungeefan,

I've added some comments based on your questions. I don't think there is currently a way to get the user preferences without clearing the cache.

@Bungeefan Bungeefan marked this pull request as ready for review October 8, 2025 13:20
Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

A little more feedback and also for fixing the psalm errors just rebase this branch on main. The types were out of date and have been updated.

Signed-off-by: Severin Hamader <severin.hamader@yahoo.de>
Signed-off-by: Severin Hamader <severin.hamader@yahoo.de>
Signed-off-by: Severin Hamader <severin.hamader@yahoo.de>
Signed-off-by: Severin Hamader <severin.hamader@yahoo.de>
Co-authored-by: Lukas Schaefer <lukas@lschaefer.xyz>
Signed-off-by: Severin <severin.hamader@yahoo.de>
Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

4.2.0 was released so this can now be merged and released in the next release.

@lukasdotcom lukasdotcom merged commit d58f45f into nextcloud:main Oct 10, 2025
18 checks passed
@Bungeefan
Copy link
Contributor Author

Nice, thanks for your time!

@Bungeefan Bungeefan deleted the cancel_running_job branch October 10, 2025 14:26
@lukasdotcom
Copy link
Member

lukasdotcom commented Oct 13, 2025

Hi @Bungeefan,

Thanks again for the pr. There is a community talk room for Nextcloud that I can invite you to that can help with any future contributions. I can send it to severin.hamader@yahoo.de if you are interested.

@Bungeefan
Copy link
Contributor Author

No problem, sure, would love to join :)

@lukasdotcom
Copy link
Member

No problem, sure, would love to join :)

Sent the invite

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@Bungeefan
Copy link
Contributor Author

Sent the invite

I haven't received any email yet, does this take some time?

@lukasdotcom
Copy link
Member

lukasdotcom commented Oct 14, 2025

Sent the invite

I haven't received any email yet, does this take some time?

Thanks for reaching out. You should have received it by now. I'll send it again in case something went wrong. The invite should have come from cloud-noreply@nextcloud.com

@Bungeefan
Copy link
Contributor Author

I received it now, thanks!

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.

2 participants