Skip to content

Make cache path unique#340

Merged
chennes merged 1 commit intoFreeCAD:devfrom
chennes:cachePath
Feb 9, 2026
Merged

Make cache path unique#340
chennes merged 1 commit intoFreeCAD:devfrom
chennes:cachePath

Conversation

@chennes
Copy link
Member

@chennes chennes commented Feb 9, 2026

Fix problems caused by interactions between the current cache version and old formats of the cache.

Copilot AI review requested due to automatic review settings February 9, 2026 02:43
@chennes chennes merged commit 4ee36e9 into FreeCAD:dev Feb 9, 2026
15 checks passed
@chennes chennes deleted the cachePath branch February 9, 2026 02:44
@chennes chennes added the release to main Trigger an Action to create a PR backporting to `main` label Feb 9, 2026
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

Successfully created backport PR for main:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Addon Manager’s cache base directory to a versioned, unique subfolder to prevent conflicts with caches created by older cache formats.

Changes:

  • Version the cache directory by appending a unique subdirectory (AddonManager2026-1) under getUserCachePath().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +244 to +246
# Anytime the cache format changes, increment this version number so we don't
# interfere with old versions.
self.cache_dir = os.path.join(getUserCachePath(), "AddonManager2026-1")
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The cache "version number" is currently embedded directly in the directory name ("AddonManager2026-1"), which makes it easy to forget to update consistently and also makes the intent less clear than an explicit cache-format version constant. Consider introducing a dedicated constant (e.g., CACHE_FORMAT_VERSION) and composing the directory name from it so future cache format bumps are a one-line change and the naming scheme stays consistent.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release to main Trigger an Action to create a PR backporting to `main`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments