fix(FN-2148): use hash cache-busting and fix store teardown
- Switch PluginLoader bypass-cache imports from a query string to a hash fragment for reload-safe module differentiation - Update inline documentation to reflect hash-based cache busting semantics in Node ESM imports - Close AgentStore in the affected agent-store test afterEach hook to ensure cleanup alongside TaskStore teardown
This commit is contained in:
@@ -1508,6 +1508,7 @@ describe("AgentStore", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
store.close();
|
||||
taskStore.close();
|
||||
});
|
||||
|
||||
|
||||
@@ -269,9 +269,9 @@ export class PluginLoader extends EventEmitter<{
|
||||
// Dynamic import - use cache-busting for reload scenarios
|
||||
let mod: unknown;
|
||||
if (bypassCache) {
|
||||
// Use cache-busting with timestamp for ESM modules
|
||||
// This ensures Node.js re-imports the module even if it has it cached
|
||||
const bustedPath = `${path}?reload=${Date.now()}`;
|
||||
// Use a hash fragment for cache differentiation without affecting path resolution
|
||||
// Node treats each distinct URL as a fresh import while resolving the same file path
|
||||
const bustedPath = `${path}#${Date.now()}`;
|
||||
mod = await import(bustedPath);
|
||||
} else {
|
||||
mod = await import(path);
|
||||
|
||||
Reference in New Issue
Block a user