vault-go 0.29.1 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,7 +23,15 @@ export async function resolveCrystalProjectFolder(cloud, projectId) {
|
|
|
23
23
|
if (!Array.isArray(projects))
|
|
24
24
|
return null;
|
|
25
25
|
const found = projects.find((item) => item && typeof item === 'object' && item.id === projectId);
|
|
26
|
-
|
|
26
|
+
const folder = crystalProjectFolder(found);
|
|
27
|
+
if (!folder)
|
|
28
|
+
return null;
|
|
29
|
+
// Why: same-named projects used to share one Crystal folder and mix their
|
|
30
|
+
// memories. The oldest keeps the plain name (existing folders stay put); newer
|
|
31
|
+
// namesakes get a stable suffix from their id. Projects arrive newest first.
|
|
32
|
+
const namesakes = projects.filter((item) => crystalProjectFolder(item)?.toLowerCase() === folder.toLowerCase());
|
|
33
|
+
const oldest = namesakes.at(-1);
|
|
34
|
+
return oldest?.id === projectId ? folder : `${folder}-${projectId.slice(0, 8)}`;
|
|
27
35
|
}
|
|
28
36
|
export async function mirrorCrystalMemory(input) {
|
|
29
37
|
if (!shouldMirrorCrystalMemory(input.job))
|