- Build: explicitly write tt-native package.json into the bundle in
CI / Build & Test (push) Successful in 3m47s
CI / Build & Test (push) Successful in 3m47s
patchBundle so the runtime never gets empty content for that key (fixes "Unexpected end of JSON input" in Module._extensions..json when the host is started by the extension on Windows). - State: treat empty or whitespace-only state.json (and legacy persist file) as missing and return default state instead of throwing in JSON.parse. - State: add ensureStorageDir() and call it from message-router after setStoragePath so the storage directory exists on fresh install before any state is loaded or saved.
This commit is contained in:
@@ -65,6 +65,10 @@ function setStoragePath(baseDir) {
|
||||
stateModule.setStoragePath(baseDir);
|
||||
}
|
||||
|
||||
function ensureStorageDir() {
|
||||
stateModule.ensureStorageDir();
|
||||
}
|
||||
|
||||
// ── Restore persisted state ───────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
@@ -108,6 +112,7 @@ module.exports = {
|
||||
setEventEmitter,
|
||||
// Storage
|
||||
setStoragePath,
|
||||
ensureStorageDir,
|
||||
// Settings
|
||||
getSettings: settingsModule.getSettings,
|
||||
updateSettings: settingsModule.updateSettings,
|
||||
|
||||
Reference in New Issue
Block a user