Skip to content

Commit

Permalink
Don't store timestamp since clients may have different system times
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl authored Apr 20, 2023
1 parent 22523dd commit 63bb4c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/vs/platform/storage/common/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ export interface IStorageValueChangeEvent {
* removed.
*/
readonly target: StorageTarget | undefined;

/**
* A utility for translating absolute URIs from another
* workspace into URIs for the current workspace if the
* workspaces share a common workspace identity.
* @param uri An absolute resource URI referenced in the
* storage value that changed.
* @returns A transformed resource URI that applies to
* the current workspace, or the original URI if no
* transformation was possible.
*/
readonly uriResolver?: (uri: URI) => URI;
}

export interface IStorageTargetChangeEvent {
Expand Down
4 changes: 1 addition & 3 deletions src/vs/workbench/contrib/scm/common/scmService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,10 @@ class SCMInput implements ISCMInput {
if (history.length === 0 || (history.length === 1 && history[0] === '')) {
storageService.remove(key, StorageScope.APPLICATION);
} else {
const timestamp = new Date().getTime();
storageService.store(key, JSON.stringify({ timestamp: timestamp, history }), StorageScope.APPLICATION, StorageTarget.MACHINE);
storageService.store(key, JSON.stringify({ timestamp: new Date().getTime(), history }), StorageScope.APPLICATION, StorageTarget.MACHINE);
storageService.store(SCMInput.roamableWorkspaceInputKey,
JSON.stringify({
absoluteUris: [this.repository.provider.rootUri!.toString()],
timestamp: timestamp,
history
}),
StorageScope.ROAMABLE_WORKSPACE,
Expand Down

0 comments on commit 63bb4c4

Please sign in to comment.