@bitcobblers/wod-wiki-engine 0.62.2261 → 0.62.2263

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -941,13 +941,13 @@ function csvToTelemetryBundle(csv) {
941
941
  }
942
942
 
943
943
  // src/version.ts
944
- var VERSION = "0.62.2261";
945
- var GIT_SHA = "e0e9bb0";
946
- var BUILD_TIME = "2026-11-23T01:20:07.186Z";
944
+ var VERSION = "0.62.2263";
945
+ var GIT_SHA = "fd25940";
946
+ var BUILD_TIME = "2026-11-23T19:21:39.932Z";
947
947
  var SEMVER = {
948
- version: "0.62.2261",
949
- gitSha: "e0e9bb0",
950
- buildTime: "2026-11-23T01:20:07.186Z"
948
+ version: "0.62.2263",
949
+ gitSha: "fd25940",
950
+ buildTime: "2026-11-23T19:21:39.932Z"
951
951
  };
952
952
  var SEED_SCHEMA = 9;
953
953
  var SEED_REGISTERED_WIDGETS = wodWikiCore.KNOWN_SECTION_WIDGETS;
@@ -2082,6 +2082,7 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
2082
2082
  if (!owned.has(id)) continue;
2083
2083
  const existing = existingById.get(id);
2084
2084
  if (!existing) continue;
2085
+ if (existing.seedOrigin !== "seed") continue;
2085
2086
  const preservedRetention = pinnedNoteIds.has(id) || existing.retention === "session-pinned" ? "session-pinned" : existing.retention === "schedule-pinned" ? "schedule-pinned" : void 0;
2086
2087
  if (preservedRetention) {
2087
2088
  const preserved = {
@@ -2110,6 +2111,8 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
2110
2111
  `feed:${feedSourceId}`,
2111
2112
  ...write.manifest.chunks.filter((c) => c.id.startsWith("notebook.")).map((c) => `notebook/${notebookSlugForChunkId(c.id)}`)
2112
2113
  ];
2114
+ const existingAll = await overrideStore.getAll();
2115
+ const existingByOvId = new Map(existingAll.map((ov) => [ov.id, ov]));
2113
2116
  const wantedIds = /* @__PURE__ */ new Set();
2114
2117
  const toPut = [];
2115
2118
  for (const [idx, row] of write.rows.entries()) {
@@ -2118,7 +2121,9 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
2118
2121
  for (const scope of scopes) {
2119
2122
  const ovId = makeScopedOverrideId(scope, kind, parsed.slug);
2120
2123
  wantedIds.add(ovId);
2121
- toPut.push({
2124
+ const priorOv = existingByOvId.get(ovId);
2125
+ if (priorOv && priorOv.seedOrigin !== "seed") continue;
2126
+ const candidate = {
2122
2127
  id: ovId,
2123
2128
  notebookId: scope,
2124
2129
  kind,
@@ -2130,13 +2135,13 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
2130
2135
  seedOrigin: "seed",
2131
2136
  feedSourceId,
2132
2137
  updatedAt: write.meta.importedAt
2133
- });
2138
+ };
2139
+ if (!priorOv || !equal(priorOv, candidate)) toPut.push(candidate);
2134
2140
  }
2135
2141
  }
2136
2142
  if (toPut.length > 0) await overrideStore.putMany(toPut);
2137
- const existingAll = await overrideStore.getAll();
2138
2143
  for (const existingOv of existingAll) {
2139
- if (existingOv.seedOrigin === "seed" && existingOv.feedSourceId === feedSourceId && existingOv.kind === kind && !wantedIds.has(existingOv.id)) {
2144
+ if (existingOv.seedOrigin === "seed" && existingOv.feedSourceId === feedSourceId && existingOv.kind === kind && !wantedIds.has(existingOv.id) && (!existingOv.ownerNoteId || !declared.has(existingOv.ownerNoteId))) {
2140
2145
  await overrideStore.delete(existingOv.id);
2141
2146
  }
2142
2147
  }