fix: invalidate skills cache with loadSkills directory key
performConfigRefresh passed client-directory-first path into invalidateSkillsLoadCache, missing the active-project cache key used by loadSkills after the repository-local skills discovery fix. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
This commit is contained in:
co-authored by
Serhii Dziupin
parent
049600df72
commit
576791d024
@@ -100,4 +100,20 @@ describe('useSkillsStore directory resolution', () => {
|
||||
group: undefined,
|
||||
}]);
|
||||
});
|
||||
|
||||
test('invalidateSkillsLoadCache() with no argument clears the active-project cache key used by loadSkills', async () => {
|
||||
expect(await useSkillsStore.getState().loadSkills()).toBe(true);
|
||||
expect(runtimeFetchCalls.length).toBe(1);
|
||||
|
||||
// Wrong key: client-directory-first null maps to __default__, not the active project.
|
||||
invalidateSkillsLoadCache(null);
|
||||
expect(await useSkillsStore.getState().loadSkills()).toBe(true);
|
||||
expect(runtimeFetchCalls.length).toBe(1);
|
||||
|
||||
// Default resolution must match loadSkills (active project first).
|
||||
invalidateSkillsLoadCache();
|
||||
expect(await useSkillsStore.getState().loadSkills()).toBe(true);
|
||||
expect(runtimeFetchCalls.length).toBe(2);
|
||||
expect(runtimeFetchCalls[1]?.url).toContain(`directory=${encodeURIComponent(activeProjectPath)}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user