@vue-skuilder/db 0.2.9 → 0.2.10

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.2.9",
7
+ "version": "0.2.10",
8
8
  "description": "Database layer for vue-skuilder",
9
9
  "main": "dist/index.js",
10
10
  "module": "dist/index.mjs",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@nilock2/pouchdb-authentication": "^1.0.2",
51
- "@vue-skuilder/common": "0.2.9",
51
+ "@vue-skuilder/common": "0.2.10",
52
52
  "cross-fetch": "^4.1.0",
53
53
  "moment": "^2.29.4",
54
54
  "pouchdb": "^9.0.0",
@@ -62,5 +62,5 @@
62
62
  "vite": "^8.0.0",
63
63
  "vitest": "^4.1.0"
64
64
  },
65
- "stableVersion": "0.2.9"
65
+ "stableVersion": "0.2.10"
66
66
  }
@@ -438,9 +438,18 @@ above:\n${above.rows.map((r) => `\t${r.id}-${r.key}\n`)}`;
438
438
  }
439
439
 
440
440
  async getAllCardIds(): Promise<string[]> {
441
+ // Card `_id`s are minted as `<DocTypePrefixes[CARD]>-<...>` (see courseAPI),
442
+ // i.e. the `c-` prefix \u2014 for both framework-minted uuid ids (`c-<uuid>`) and
443
+ // course-authored deterministic ids (e.g. LettersPractice's `c-intro-s-S`).
444
+ //
445
+ // The previous implementation hardcoded a `CARD-` prefix range, which never
446
+ // matched any card and silently returned an EMPTY list, starving the only
447
+ // callers (`forecast()` / `diagnoseCardSpace()`). Use the prefix const so
448
+ // the range stays correct if the scheme ever changes.
449
+ const prefix = `${DocTypePrefixes[DocType.CARD]}-`;
441
450
  const result = await this.db.allDocs({
442
- startkey: 'CARD-',
443
- endkey: 'CARD-\ufff0',
451
+ startkey: prefix,
452
+ endkey: `${prefix}\ufff0`,
444
453
  include_docs: false,
445
454
  });
446
455
  return result.rows.map((row) => row.id);