In my FileProviderExtension, I implemented
func stopProvidingItem(at url: URL)
and cancel a running download for the concerned URL there should one be in progress. I hadn't figured out that this is also where cancelling has to take place, I was lucky enough to get this info at this year's WWDC labs.
And sure enough, cancelling downloads there works. But... the download indicator never gets removed from the file's icon.
isDownloading afterwards returns false, I do signal the change, I tried messing with the task's progress object in various ways (manually setting its completedUnitCount to its totalUnitCount, setting its progress, callings its cancellationHandler), but most of those solutions didn't seem right and none of them actually worked.
What is the correct way to remove the progress indicator after cancelling a download? I even compared our solution to other solutions out there on the market and haven't seen one implementation that is able to remove the progress indicator from the icon as iCloud is able to.