Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/storage/object/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const copyFile = async (config, env, daCtx, sourceKey, details, isRename)
} finally {
if (Key.endsWith('.html')) {
// Reset the collab cached state for the copied object
await notifyCollab('syncAdmin', `${daCtx.origin}/source/${daCtx.org}/${Key}`, env);
await notifyCollab('syncadmin', `${daCtx.origin}/source/${daCtx.org}/${Key}`, env);
}
}
};
Expand Down
8 changes: 4 additions & 4 deletions test/storage/object/copy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('Object copy', () => {
assert.strictEqual(1, collabcalls.length);
assert.deepStrictEqual(
collabcalls,
['https://localhost/api/v1/syncAdmin?doc=somehost.sometld/source/foo/mydir/newdir/xyz.html'],
['https://localhost/api/v1/syncadmin?doc=somehost.sometld/source/foo/mydir/newdir/xyz.html'],
);
});

Expand Down Expand Up @@ -299,7 +299,7 @@ describe('Object copy', () => {

assert.deepStrictEqual(
collabcalls,
['https://localhost/api/v1/syncAdmin?doc=http://localhost:3000/source/testorg/mydir/dir2/myfile.html'],
['https://localhost/api/v1/syncadmin?doc=http://localhost:3000/source/testorg/mydir/dir2/myfile.html'],
);
});

Expand Down Expand Up @@ -397,7 +397,7 @@ describe('Object copy', () => {

assert.deepStrictEqual(
collabCalled,
['https://localhost/api/v1/syncAdmin?doc=https://blahblah:7890/source/myorg/mydst/abc/def.html'],
['https://localhost/api/v1/syncadmin?doc=https://blahblah:7890/source/myorg/mydst/abc/def.html'],
);
});

Expand Down Expand Up @@ -522,7 +522,7 @@ describe('Object copy', () => {
assert.strictEqual(resp.$metadata.httpStatusCode, 404);
assert.deepStrictEqual(
collabCalled,
['https://localhost/api/v1/syncAdmin?doc=http://qqq/source/qqqorg/qqqdst/abc/def.html'],
['https://localhost/api/v1/syncadmin?doc=http://qqq/source/qqqorg/qqqdst/abc/def.html'],
);
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/storage/utils/object.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ describe('Storage Object Utils tests', () => {
const { called, env } = setupEnv();

assert.strictEqual(called.length, 0, 'precondition');
await notifyCollab('syncAdmin', 'https://admin.da.live/source/a/b/c.html', env);
await notifyCollab('syncadmin', 'https://admin.da.live/source/a/b/c.html', env);
assert.strictEqual(called.length, 1);
assert.strictEqual(called[0], 'https://localhost/api/v1/syncAdmin?doc=https://admin.da.live/source/a/b/c.html');
assert.strictEqual(called[0], 'https://localhost/api/v1/syncadmin?doc=https://admin.da.live/source/a/b/c.html');
});

it('Should not invalidate non-html documents', async () => {
const { called, env } = setupEnv();

assert.strictEqual(called.length, 0, 'precondition');
await notifyCollab('syncAdmin', 'https://admin.da.live/source/a/b/c.jpg', env);
await notifyCollab('syncAdmin', 'https://admin.da.live/source/a/b/c/d', env);
await notifyCollab('syncadmin', 'https://admin.da.live/source/a/b/c.jpg', env);
await notifyCollab('syncadmin', 'https://admin.da.live/source/a/b/c/d', env);
assert.strictEqual(called.length, 0, 'should not have invalidated anything');
});

Expand All @@ -58,8 +58,8 @@ describe('Storage Object Utils tests', () => {
COLLAB_SHARED_SECRET: 'example-secret',
};
assert.strictEqual(called.length, 0, 'precondition');
await notifyCollab('syncAdmin', 'https://admin.da.live/source/a/b/c.html', env);
await notifyCollab('syncadmin', 'https://admin.da.live/source/a/b/c.html', env);
assert.strictEqual(called.length, 1);
assert.strictEqual(called[0], 'https://localhost/api/v1/syncAdmin?doc=https://admin.da.live/source/a/b/c.html');
assert.strictEqual(called[0], 'https://localhost/api/v1/syncadmin?doc=https://admin.da.live/source/a/b/c.html');
});
});