feat: automatically detect media location changes (#20256)

This commit is contained in:
Jason Rasmussen
2025-07-25 15:25:36 -04:00
committed by GitHub
parent 0fdeac0417
commit c6b25ef111
8 changed files with 43 additions and 8 deletions
@@ -19,6 +19,7 @@ describe(StorageService.name, () => {
describe('onBootstrap', () => {
it('should enable mount folder checking', async () => {
mocks.systemMetadata.get.mockResolvedValue(null);
mocks.asset.getFileSamples.mockResolvedValue([]);
await expect(sut.onBootstrap()).resolves.toBeUndefined();
@@ -75,6 +76,7 @@ describe(StorageService.name, () => {
upload: true,
},
});
mocks.asset.getFileSamples.mockResolvedValue([]);
await expect(sut.onBootstrap()).resolves.toBeUndefined();
@@ -128,6 +130,7 @@ describe(StorageService.name, () => {
error.code = 'EEXIST';
mocks.systemMetadata.get.mockResolvedValue({ mountChecks: {} });
mocks.storage.createFile.mockRejectedValue(error);
mocks.asset.getFileSamples.mockResolvedValue([]);
await expect(sut.onBootstrap()).resolves.toBeUndefined();
@@ -149,6 +152,7 @@ describe(StorageService.name, () => {
storage: { ignoreMountCheckErrors: true },
}),
);
mocks.asset.getFileSamples.mockResolvedValue([]);
mocks.storage.overwriteFile.mockRejectedValue(
new Error("ENOENT: no such file or directory, open '/app/.immich'"),
);