@budibase/backend-core 2.13.7 → 2.13.9

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.js CHANGED
@@ -2288,11 +2288,16 @@ var init_DatabaseImpl = __esm({
2288
2288
  keys: ids,
2289
2289
  include_docs: true
2290
2290
  });
2291
- const NOT_FOUND = "not_found";
2292
- const rows = response.rows.filter((row) => row.error !== NOT_FOUND);
2291
+ const rowUnavailable = (row) => {
2292
+ if (row.doc == null || "deleted" in row.value && row.value.deleted) {
2293
+ return true;
2294
+ }
2295
+ return row.error === "not_found";
2296
+ };
2297
+ const rows = response.rows.filter((row) => !rowUnavailable(row));
2293
2298
  const someMissing = rows.length !== response.rows.length;
2294
2299
  if (!opts?.allowMissing && someMissing) {
2295
- const missing = response.rows.filter((row) => row.error === NOT_FOUND);
2300
+ const missing = response.rows.filter((row) => rowUnavailable(row));
2296
2301
  const missingIds = missing.map((row) => row.key).join(", ");
2297
2302
  throw new Error(`Unable to get documents: ${missingIds}`);
2298
2303
  }