mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
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:
1 parent
feb3253bec
commit
9ecd497f1e
4 files changed
+40
-12
No files matched your search
@@ -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 };
|
||||
|
||||
Reference in new issue
Block a user