Replace timestamp-based IDs with UUIDs for guaranteed uniqueness and race condition safety

This commit is contained in:
Torsten Schulz (local)
2025-10-21 15:23:48 +02:00
parent 8eb83a5c6a
commit 0494d2cbf4
18 changed files with 149 additions and 154 deletions

View File

@@ -45,8 +45,9 @@ async function saveNews(newsData) {
}
} else {
const newItem = {
id: `n${Date.now()}`,
...newsData,
id: `n${Date.now()}`,
// ID must come AFTER ...newsData to not be overwritten
created: (/* @__PURE__ */ new Date()).toISOString(),
updated: (/* @__PURE__ */ new Date()).toISOString()
};