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/sdk/namespace_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ class NamespaceCache {
source_stream: cache_stream,
async_get_last_modified_time: async () => {
const upload_res = await hub_promise;
const last_modified_time = (new Date(upload_res.last_modified_time)).getTime();
const last_modified_time = (new Date(upload_res.date)).getTime();
if (isNaN(last_modified_time)) {
throw new Error('Invalid last_modified_time returned from hub_promise, Expected a valid date or timestamp.');
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/unit_tests/internal/test_namespace_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class MockNamespace {
if (this._write_err) {
// Simulate success in the case that the error is caused by other stream
console.log(`${this.type} mock: write err bucket ${params.bucket} key ${params.key}`);
resolve({ etag, last_modified_time: create_time });
resolve({ etag, date: create_time });
return;
}

Expand All @@ -296,7 +296,7 @@ class MockNamespace {
buf: this._buf,
size: params.size,
});
resolve({ etag, last_modified_time: create_time });
resolve({ etag, date: create_time });
});
params.source_stream.on('finish', async () => {
console.log(`${this.type} mock: got finish in upload_object: bucket ${params.bucket} key ${params.key}`, recv_buf);
Expand Down Expand Up @@ -434,7 +434,7 @@ mocha.describe('namespace caching: upload scenarios', () => {
return !_.isUndefined(cache_obj_create_time);
}, 5000);
const cache_obj = cache.get_obj(bucket, key);
assert(cache_obj.create_time === ret.last_modified_time);
assert(cache_obj.create_time === ret.date);
});

mocha.it('hub upload failure: object not cached', async () => {
Expand Down