Reserve the deleted marker for tombstones

Imports and uploads could carry deleted: false, which the loader took for
a tombstone on the next restart. The schemas now reject the property, and
the loader only treats deleted: true as a tombstone and strips the key from
entries already saved with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-18 19:53:36 +00:00
1 parent feb3253bec
commit 9ecd497f1e
4 files changed
+40 -12

No files matched your search

+4 -2
View File
@@ -41,10 +41,12 @@ async function loadDatabase(config: lib.ControllerConfig, logger: lib.Logger) {
let playerDatastore = new Map<string, IpcPlayerData>();
let tombstones = new Map<string, Tombstone>();
for (let [name, entry] of entries) {
if ("deleted" in entry) {
if ("deleted" in entry && entry.deleted === true) {
tombstones.set(name, entry);
} else {
playerDatastore.set(name, entry);
// Imports used to keep the marker
delete (entry as any).deleted;
playerDatastore.set(name, entry as IpcPlayerData);
}
}
return { playerDatastore, tombstones };