Skip to content

Commit 889d6fa

Browse files
committed
don't cache old versions
1 parent 113e81e commit 889d6fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/b2c-tooling-sdk/src/skills/github.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,11 @@ export async function downloadSkillsArtifact(skillSet: SkillSet, options: Downlo
226226
// Extract actual version from the final URL (after redirects)
227227
const actualVersion = extractVersionFromUrl(response.url) || version;
228228

229-
// Check cache for the resolved version (for 'latest' which we now know)
230-
if (version === 'latest' && !forceDownload) {
229+
// Check cache for the resolved version (for 'latest' which we now know the real tag)
230+
// Only use cache if we actually resolved a real version — if actualVersion is still
231+
// 'latest' (e.g., redirect URL didn't contain the tag), we must re-extract since
232+
// we can't tell if the cached 'latest' is stale.
233+
if (version === 'latest' && actualVersion !== 'latest' && !forceDownload) {
231234
const cached = getCachedArtifact(actualVersion, skillSet);
232235
if (cached && fs.existsSync(cached.path)) {
233236
logger.debug({version: actualVersion, skillSet, path: cached.path}, 'Using cached skills (resolved latest)');

0 commit comments

Comments
 (0)