fix: rebuild ready snapshots on an explicit refresh (#890)

* fix repository refresh failing to reflect new public GitHub commits

* test: cover forced snapshot rebuilds and unchanged background refresh

* fix: serialize missing-tree recovery with owner refreshes

---------

Co-authored-by: Thomas Durieux <5577568+tdurieux@users.noreply.github.com>
This commit is contained in:
KozakLordOfMatrixandThomas Durieux authored and GitHub committed 2026-10-11 11:53:45 +01:00
1 parent bee729e0ee
commit 4a06aa9888
3 files changed
+75 -5

No files matched your search

+2 -2
View File
@@ -389,7 +389,7 @@ const uri = process.env.PERFORMANCE_MONGO_URI;
expect(response).to.deep.equal({ "": 1, src: 1 });
await File.deleteMany({ repoId: model.repoId, treeGeneration: "active" });
let refreshed = false;
repo.updateIfNeeded = async ({ force }) => { refreshed = force; };
repo.refresh = async () => { refreshed = true; };
expect(await repo.isReady()).to.equal(false); expect(refreshed).to.equal(true);
} finally { utils.getRepo = getRepo; }
});
@@ -716,7 +716,7 @@ const uri = process.env.PERFORMANCE_MONGO_URI;
expect((await Repo.findById(model._id)).emptyTreeGeneration).to.equal(undefined);
await File.deleteMany({ repoId: model.repoId });
let refreshed = false;
fresh.updateIfNeeded = async () => { refreshed = true; };
fresh.refresh = async () => { refreshed = true; };
expect(await fresh.isReady()).to.equal(false); expect(refreshed).to.equal(true);
});