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!

@Bungeefan Bungeefan force-pushed the cancel_running_job branch 3 times, most recently from dce72c6 to dcc4750 Compare October 3, 2025 11:02
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 force-pushed the cancel_running_job branch 3 times, most recently from c63d640 to 5889915 Compare October 8, 2025 13:19
@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.

Co-authored-by: Lukas Schaefer <[email protected]>
Signed-off-by: Severin <[email protected]>
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.

2 participants