Skip to content

Appcast order deltas#2848

Merged
zorgiepoo merged 6 commits intosparkle-project:2.xfrom
Cykelero:appcast-order-deltas
Feb 21, 2026
Merged

Appcast order deltas#2848
zorgiepoo merged 6 commits intosparkle-project:2.xfrom
Cykelero:appcast-order-deltas

Conversation

@Cykelero
Copy link
Copy Markdown
Contributor

Makes order of deltas stable in appcasts generated by generate_appcast.

Also (probably?) makes the insertion of new deltas thread-safe.

Fixes #2846.

I tested and verified my change by using one or multiple of these methods:

  • My own app

Checked updating the Retcon appcast with the new code.

macOS version tested: 26.3

@zorgiepoo
Copy link
Copy Markdown
Member

zorgiepoo commented Feb 18, 2026

So the update items are already sorted before doing the concurrent dispatch. It's kind of brute force approach to lose order by inserting delta updates in any order and then re-sort all of them again later by enumerating through all potential objects. Also the code cannot assume the versions are integers (see descendingVersionComparator usage earlier in the file).

A simpler approach I think is just to opportunistically add the delta item before the dispatch. Remove it if we need to mark the delta as ignored (by finding the firstIndex() and then remove()). That will have to be synchronized in the DispatchQueue.main.async. No need to re-sort again.

@Cykelero
Copy link
Copy Markdown
Contributor Author

Oh yeah, this is much nicer!

I ended up using removeAll() instead of firstIndex()+remove().

I test on the Retcon appcast again, and also tried artificially making some deltas not have a signature; both the ordering and filtering seem to work.

Greatest deltaFrom value first.

Also, fix inserting deltas that should have been ignored.
@Cykelero
Copy link
Copy Markdown
Contributor Author

OK, changes applied.

@zorgiepoo zorgiepoo added this to the 2.9.0 milestone Feb 21, 2026
@zorgiepoo
Copy link
Copy Markdown
Member

Works for me locally. Merging. Thanks!

@zorgiepoo zorgiepoo merged commit 79475ea into sparkle-project:2.x Feb 21, 2026
2 checks passed
@Cykelero
Copy link
Copy Markdown
Contributor Author

Great! Thank you for making these final changes, I was a bit busy.

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.

In generated appcast, make delta order stable

2 participants