Skip to content

Add GsPluginJobCancelOfflineUpdate and use it to replace gs_plugin_update_cancel()

These commits are from @mcrha, split out from !1875, rebased, reviewed and slightly tweaked by me to fix review issues. The things I’ve changed:

  • Renamed GsPluginJobUpdateCancel to GsPluginJobCancelOfflineUpdates to clearer reflect what it does, in particular pointing out that it’s relevant only to offline updates
  • Dropped the GsPluginJobCancelOfflineUpdates:app property as it didn’t really do anything: a triggered offline update is a system-wide state, and can’t be cancelled for a single app
    • An offline update typically affects a whole GsAppList anyway, not just a single app
    • If we do need to differentiate between triggered offline updates for different plugins in future, I think a more robust approach would be to have GsPluginJobUpdateApps and GS_PLUGIN_ACTION_UPGRADE_TRIGGER return an opaque token on success, which can then be passed to GsPluginJobCancelOfflineUpdates to cancel exactly that offline update. The token would probably either be a plugin identifier, or the GsAppList of apps which were scheduled for update.
  • Fully drop GS_PLUGIN_ACTION_UPDATE_CANCEL as it wasn’t meaningfully used anywhere any more

Helps: #1472

Merge request reports