Skip to content

Commit d38c5b8

Browse files
authored
storage - enable global storage, disable workspace storage migration (microsoft#64719)
1 parent 29179ea commit d38c5b8

15 files changed

Lines changed: 47 additions & 1045 deletions

File tree

src/main.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,18 @@ bootstrap.enableASARSupport();
2828
const args = parseCLIArgs();
2929
const userDataPath = getUserDataPath(args);
3030

31-
// TODO@Ben global storage migration needs to happen very early before app.on("ready")
32-
// We copy the DB instead of moving it to ensure we are not running into locking issues
33-
if (process.env['VSCODE_TEST_STORAGE_MIGRATION']) {
34-
try {
35-
const globalStorageHome = path.join(userDataPath, 'User', 'globalStorage', 'temp.vscdb');
36-
const localStorageHome = path.join(userDataPath, 'Local Storage');
37-
const localStorageDB = path.join(localStorageHome, 'file__0.localstorage');
38-
const localStorageDBBackup = path.join(localStorageHome, 'file__0.localstorage.vscmig');
39-
if (!fs.existsSync(globalStorageHome) && fs.existsSync(localStorageDB)) {
40-
fs.copyFileSync(localStorageDB, localStorageDBBackup);
41-
}
42-
} catch (error) {
43-
console.error(error);
31+
// global storage migration needs to happen very early before app.on("ready")
32+
// TODO@Ben remove after a while
33+
try {
34+
const globalStorageHome = path.join(userDataPath, 'User', 'globalStorage', 'state.vscdb');
35+
const localStorageHome = path.join(userDataPath, 'Local Storage');
36+
const localStorageDB = path.join(localStorageHome, 'file__0.localstorage');
37+
const localStorageDBBackup = path.join(localStorageHome, 'file__0.vscmig');
38+
if (!fs.existsSync(globalStorageHome) && fs.existsSync(localStorageDB)) {
39+
fs.renameSync(localStorageDB, localStorageDBBackup);
4440
}
41+
} catch (error) {
42+
console.error(error);
4543
}
4644

4745
app.setPath('userData', userDataPath);

src/tsconfig.strictNullChecks.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@
505505
"./vs/platform/state/node/stateService.ts",
506506
"./vs/platform/statusbar/common/statusbar.ts",
507507
"./vs/platform/storage/common/storage.ts",
508-
"./vs/platform/storage/common/storageLegacyService.ts",
509508
"./vs/platform/storage/node/storageMainService.ts",
510509
"./vs/platform/telemetry/browser/errorTelemetry.ts",
511510
"./vs/platform/telemetry/common/telemetry.ts",

src/vs/code/electron-browser/workbench/workbench.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,7 @@ function showPartsSplash(configuration) {
5757

5858
let data;
5959
try {
60-
if (!process.env['VSCODE_TEST_STORAGE_MIGRATION']) {
61-
// TODO@Ben remove me after a while
62-
perf.mark('willReadLocalStorage');
63-
let raw = window.localStorage.getItem('storage://global/parts-splash-data');
64-
perf.mark('didReadLocalStorage');
65-
data = JSON.parse(raw);
66-
} else {
67-
data = JSON.parse(configuration.partsSplashData);
68-
}
60+
data = JSON.parse(configuration.partsSplashData);
6961
} catch (e) {
7062
// ignore
7163
}

src/vs/platform/storage/common/storageLegacyMigration.ts

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)