### Fixed

- Now fetching configuration from server can handle the empty remote correctly (reported on #756) by common-lib.
- No longer asking to switch adapters during rebuilding.
This commit is contained in:
vorotamoroz
2025-11-18 08:51:32 +00:00
parent bf754d6e07
commit 4c761eebff
2 changed files with 23 additions and 22 deletions

Submodule src/lib updated: 86b0a95d56...9393ff1e08

View File

@@ -77,7 +77,7 @@ Please enable them from the settings screen after setup is complete.`,
async rebuildEverything() { async rebuildEverything() {
await this.services.setting.suspendExtraSync(); await this.services.setting.suspendExtraSync();
await this.askUseNewAdapter(); // await this.askUseNewAdapter();
this.core.settings.isConfigured = true; this.core.settings.isConfigured = true;
await this.services.setting.realiseSetting(); await this.services.setting.realiseSetting();
await this.resetLocalDatabase(); await this.resetLocalDatabase();
@@ -167,28 +167,29 @@ Please enable them from the settings screen after setup is complete.`,
await this.services.replication.onBeforeReplicate(false); //TODO: Check actual need of this. await this.services.replication.onBeforeReplicate(false); //TODO: Check actual need of this.
await this.core.saveSettings(); await this.core.saveSettings();
} }
async askUseNewAdapter() { // No longer needed, both adapters have each advantages and disadvantages.
if (!this.core.settings.useIndexedDBAdapter) { // async askUseNewAdapter() {
const message = `Now this core has been configured to use the old database adapter for keeping compatibility. Do you want to deactivate it?`; // if (!this.core.settings.useIndexedDBAdapter) {
const CHOICE_YES = "Yes, disable and use latest"; // const message = `Now this core has been configured to use the old database adapter for keeping compatibility. Do you want to deactivate it?`;
const CHOICE_NO = "No, keep compatibility"; // const CHOICE_YES = "Yes, disable and use latest";
const choices = [CHOICE_YES, CHOICE_NO]; // const CHOICE_NO = "No, keep compatibility";
// const choices = [CHOICE_YES, CHOICE_NO];
const ret = await this.core.confirm.confirmWithMessage( //
"Database adapter", // const ret = await this.core.confirm.confirmWithMessage(
message, // "Database adapter",
choices, // message,
CHOICE_YES, // choices,
10 // CHOICE_YES,
); // 10
if (ret == CHOICE_YES) { // );
this.core.settings.useIndexedDBAdapter = true; // if (ret == CHOICE_YES) {
} // this.core.settings.useIndexedDBAdapter = true;
} // }
} // }
// }
async fetchLocal(makeLocalChunkBeforeSync?: boolean, preventMakeLocalFilesBeforeSync?: boolean) { async fetchLocal(makeLocalChunkBeforeSync?: boolean, preventMakeLocalFilesBeforeSync?: boolean) {
await this.services.setting.suspendExtraSync(); await this.services.setting.suspendExtraSync();
await this.askUseNewAdapter(); // await this.askUseNewAdapter();
this.core.settings.isConfigured = true; this.core.settings.isConfigured = true;
await this.suspendReflectingDatabase(); await this.suspendReflectingDatabase();
await this.services.setting.realiseSetting(); await this.services.setting.realiseSetting();