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: 2 additions & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ When a change has user-facing documentation, include a canonical tasknotes.dev l

## Fixed

- Stop plugin startup when an existing settings file cannot be read, preserving it for recovery instead of starting services with default settings.

- (#1849) Fixed context menus stacking on top of each other. Only one menu stays open at a time, and clicking the same indicator again closes its menu. This previously applied to date fields only, and now covers priority, status, recurrence, reminders, task, ICS event, and batch menus.
- Thanks to @3zra47 for reporting and @YBKF for the contribution.

Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ export default class TaskNotesPlugin extends Plugin {
},
});
}
if (result.compromised)
throw new Error(
"TaskNotes settings are unreadable; restore settings before loading the plugin."
);
return result.data;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/issues/issue-1591-settings-lost-on-update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe("issue #1591 settings reset on update", () => {
const plugin = createPlugin({ dataFileExists: true });
plugin.loadData = jest.fn().mockResolvedValue(null);

await plugin.loadSettings();
await plugin.checkForVersionUpdate();
await expect(plugin.loadSettings()).rejects.toThrow("settings are unreadable");
await plugin.saveSettingsDataOnly();

expect(plugin.loadData).toHaveBeenCalledTimes(4);
expect(plugin.saveData).not.toHaveBeenCalled();
Expand Down
Loading