Skip to content

Handle .service bundle identifiers in cache paths - #2907

Open
youngjunning wants to merge 1 commit into
sparkle-project:2.xfrom
youngjunning:fix/service-cache-directory
Open

Handle .service bundle identifiers in cache paths#2907
youngjunning wants to merge 1 commit into
sparkle-project:2.xfrom
youngjunning:fix/service-cache-directory

Conversation

@youngjunning

@youngjunning youngjunning commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Sparkle already appends .sparkle when a bundle identifier ends in .app, preventing the cache directory from being treated as an application bundle. macOS also recognizes .service as a Service Application bundle, so identifiers ending in .service need the same neutral cache suffix.

This change normalizes the final identifier extension case-insensitively, appends .sparkle for .app and .service, and preserves ordinary bundle identifiers. It also adds focused regression tests for both package-like extensions and unaffected identifiers.

This change was prepared with Codex assistance. I reviewed the complete diff and ran Sparkle's official unit-test workflow locally.

Related discussion: #2881

Misc Checklist

  • My change requires a documentation update on Sparkle's website repository
  • My change requires changes to generate_appcast, generate_keys, or sign_update
  • My change was generated/assisted using AI and if so was reviewed by me in whole (explained in the summary)

Testing

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

  • Sparkle Test App
  • Unit Tests
  • My own app
  • Other: Sparkle's CI build-for-testing and test-without-building commands

The regression tests cover .app and .service suffixes with mixed casing, plus ordinary identifiers that must remain unchanged. The full Distribution unit-test suite passed with 183 tests, 0 failures, and 0 skipped tests.

macOS version tested: 26.5.2 (Xcode 26.6)

// so that the cache directory doesn't look like an app bundle directory, which can cause other systematic issues
// https://github.com/sparkle-project/Sparkle/discussions/2881
NSString *appCacheIdentifier;
if ([bundleIdentifier hasSuffix:@".app"] || [bundleIdentifier hasSuffix:@".APP"]) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please just add the one/two more || conditions here for .service. The rest of this pull request is not needed, including the unit tests which I don't want. This is working around a macOS bug in a specific context.

@zorgiepoo zorgiepoo Sep 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel free to use caseInsensitiveCompare: on the bundleIdentifier.pathExtension in here to simplify testing for case.

@zorgiepoo

zorgiepoo commented Sep 2, 2026

Copy link
Copy Markdown
Member

Does your own app actually have a bundle identifier that ends with .service and did you reproduce the issue while running the updater? (The unit tests don't help validate this). I presume this to be a much rarer case.

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