@cloudbitmaps/core 0.8.0 → 0.8.2

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.d.cts CHANGED
@@ -2146,7 +2146,16 @@ interface DropDeps extends EraseDeps {
2146
2146
  interface DropResult {
2147
2147
  readonly segment: string;
2148
2148
  readonly namespace?: string;
2149
- /** True iff the segment is now a `destroyed` tombstone (incl. the idempotent already-dropped case). */
2149
+ /**
2150
+ * **True iff this segment is now empty as a result of this call — or already was.** This is the field a
2151
+ * retention job should branch on: `false` means the call found nothing to do and your ref is probably wrong.
2152
+ *
2153
+ * It is *not* simply "a tombstone exists", and that distinction is load-bearing. A **pure accumulator**
2154
+ * segment — one created by writing to it and never compacted, so it has no registry row and no Cold objects —
2155
+ * is retired by deleting its Warm rows alone, with no tombstone to write. That reports `dropped: true` with
2156
+ * `reason: 'warm-only'`, because the data really is gone. Reporting it as `false` (which it did until
2157
+ * `0.8.2`) made every successful retirement of an accumulator look like a failure.
2158
+ */
2150
2159
  readonly dropped: boolean;
2151
2160
  /** Warm rows physically deleted. */
2152
2161
  readonly warmRowsDeleted: number;
@@ -2197,11 +2206,19 @@ interface DropResult {
2197
2206
  */
2198
2207
  readonly cryptoShredded: boolean;
2199
2208
  /**
2200
- * `'absent'` (no registry row **and** no Cold objects — nothing existed to drop) or `'already'` (already a
2201
- * tombstone). Absent on a fresh drop.
2209
+ * How the segment got to its current state. Absent on a fresh, ordinary drop (tombstone written, Cold swept).
2210
+ *
2211
+ * - `'warm-only'` — **a successful retirement.** No registry row and no Cold objects, so this was an accumulator
2212
+ * segment: its Warm rows were deleted and it now reads empty. Pairs with `dropped: true`.
2213
+ * - `'already'` — it was already a tombstone. Idempotent; pairs with `dropped: true`. Note a re-drop is **not**
2214
+ * a no-op — it also clears Warm rows that landed after the tombstone.
2215
+ * - `'absent'` — **nothing existed.** No registry row, no Cold objects, and no Warm rows to delete. Pairs with
2216
+ * `dropped: false`, and it is the one value worth alerting on: the usual cause is a mistyped name or an
2217
+ * omitted `namespace`, both of which address a *different* segment than you meant.
2202
2218
  *
2203
- * Note what `'absent'` no longer means: it used to be returned while the call deleted every Cold generation it
2204
- * found, with no tombstone written. See {@link dropSegment}'s "the absent case" note.
2219
+ * Two things `'absent'` used to mean and no longer does: it was returned while the call deleted every Cold
2220
+ * generation it found with no tombstone written (a data-integrity bug, fixed in `0.8.0`), and it was returned
2221
+ * for a successfully retired accumulator segment (misleading, fixed in `0.8.2`).
2205
2222
  */
2206
2223
  readonly reason?: string;
2207
2224
  }
package/dist/index.d.ts CHANGED
@@ -2146,7 +2146,16 @@ interface DropDeps extends EraseDeps {
2146
2146
  interface DropResult {
2147
2147
  readonly segment: string;
2148
2148
  readonly namespace?: string;
2149
- /** True iff the segment is now a `destroyed` tombstone (incl. the idempotent already-dropped case). */
2149
+ /**
2150
+ * **True iff this segment is now empty as a result of this call — or already was.** This is the field a
2151
+ * retention job should branch on: `false` means the call found nothing to do and your ref is probably wrong.
2152
+ *
2153
+ * It is *not* simply "a tombstone exists", and that distinction is load-bearing. A **pure accumulator**
2154
+ * segment — one created by writing to it and never compacted, so it has no registry row and no Cold objects —
2155
+ * is retired by deleting its Warm rows alone, with no tombstone to write. That reports `dropped: true` with
2156
+ * `reason: 'warm-only'`, because the data really is gone. Reporting it as `false` (which it did until
2157
+ * `0.8.2`) made every successful retirement of an accumulator look like a failure.
2158
+ */
2150
2159
  readonly dropped: boolean;
2151
2160
  /** Warm rows physically deleted. */
2152
2161
  readonly warmRowsDeleted: number;
@@ -2197,11 +2206,19 @@ interface DropResult {
2197
2206
  */
2198
2207
  readonly cryptoShredded: boolean;
2199
2208
  /**
2200
- * `'absent'` (no registry row **and** no Cold objects — nothing existed to drop) or `'already'` (already a
2201
- * tombstone). Absent on a fresh drop.
2209
+ * How the segment got to its current state. Absent on a fresh, ordinary drop (tombstone written, Cold swept).
2210
+ *
2211
+ * - `'warm-only'` — **a successful retirement.** No registry row and no Cold objects, so this was an accumulator
2212
+ * segment: its Warm rows were deleted and it now reads empty. Pairs with `dropped: true`.
2213
+ * - `'already'` — it was already a tombstone. Idempotent; pairs with `dropped: true`. Note a re-drop is **not**
2214
+ * a no-op — it also clears Warm rows that landed after the tombstone.
2215
+ * - `'absent'` — **nothing existed.** No registry row, no Cold objects, and no Warm rows to delete. Pairs with
2216
+ * `dropped: false`, and it is the one value worth alerting on: the usual cause is a mistyped name or an
2217
+ * omitted `namespace`, both of which address a *different* segment than you meant.
2202
2218
  *
2203
- * Note what `'absent'` no longer means: it used to be returned while the call deleted every Cold generation it
2204
- * found, with no tombstone written. See {@link dropSegment}'s "the absent case" note.
2219
+ * Two things `'absent'` used to mean and no longer does: it was returned while the call deleted every Cold
2220
+ * generation it found with no tombstone written (a data-integrity bug, fixed in `0.8.0`), and it was returned
2221
+ * for a successfully retired accumulator segment (misleading, fixed in `0.8.2`).
2205
2222
  */
2206
2223
  readonly reason?: string;
2207
2224
  }
package/dist/index.js CHANGED
@@ -3781,14 +3781,15 @@ async function dropSegment(ref, deps, options) {
3781
3781
  if (shred.reason === "absent") {
3782
3782
  const orphans = await listGenerations(deps.cold, ref);
3783
3783
  if (orphans.length === 0) {
3784
+ const clearedWarmOnly = shred.warmRowsDeleted > 0;
3784
3785
  return {
3785
3786
  ...base,
3786
- dropped: false,
3787
+ dropped: clearedWarmOnly,
3787
3788
  warmRowsDeleted: shred.warmRowsDeleted,
3788
3789
  generationsDeleted: [],
3789
3790
  generationsRemaining: [],
3790
3791
  cryptoShredded: false,
3791
- reason: "absent"
3792
+ reason: clearedWarmOnly ? "warm-only" : "absent"
3792
3793
  };
3793
3794
  }
3794
3795
  try {