hazo_collect 0.2.3 → 0.2.4

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/CHANGE_LOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # hazo_collect — Change Log
2
2
 
3
+ ## 0.2.4 — 2026-06-14
4
+
5
+ ### Fixes — `discover()` read-back of the now-`jsonb` manifest (0.2.3 follow-up)
6
+
7
+ 0.2.3 fixed the **write** side (manifest/payload stored as real `jsonb` objects) but missed the
8
+ matching **read** site. `discover()` still did `JSON.parse(row.manifest)`, and now that the column
9
+ holds real `jsonb` the PostgREST adapter returns `row.manifest` as an already-parsed **object** —
10
+ `JSON.parse(object)` coerces to the string `"[object Object]"` and throws. The worker could not
11
+ boot: `engine.discover_failed` (`"[object Object]" is not valid JSON`) retried forever.
12
+
13
+ Fix: `src/registry/discovery.ts` reads the manifest via `parseJsonbField()` (from
14
+ `hazo_connect/server`), which normalises both shapes — an already-parsed object (PostgREST/pg
15
+ `jsonb`) and a JSON string (text/SQLite read) — instead of blindly `JSON.parse`-ing.
16
+
17
+ Regression test (`src/__tests__/discovery.test.ts`): a PostgREST-shaped adapter wrapper returns
18
+ the registry `manifest` column as an object; `discover()` must boot the worker without re-parsing.
19
+
20
+ **Requires:** `hazo_connect ^3.8.0`.
21
+
3
22
  ## 0.2.3 — 2026-06-14
4
23
 
5
24
  ### Fixes — stop double-encoding JSON columns for PostgREST/JSONB adapters
@@ -372,7 +372,7 @@ import { QueryBuilder as QueryBuilder4, wrapResult as wrapResult3 } from "hazo_c
372
372
  import { readFileSync, readdirSync } from "fs";
373
373
  import { resolve } from "path";
374
374
  import { pathToFileURL } from "url";
375
- import { QueryBuilder as QueryBuilder3 } from "hazo_connect/server";
375
+ import { QueryBuilder as QueryBuilder3, parseJsonbField } from "hazo_connect/server";
376
376
  async function scanFolder(pluginsDir) {
377
377
  const entries = readdirSync(pluginsDir, { withFileTypes: true });
378
378
  const subdirs = entries.filter((e) => e.isDirectory());
@@ -401,7 +401,7 @@ async function discover(opts) {
401
401
  const rows = await opts.adapter.query(qb);
402
402
  const snapshotEntries = [];
403
403
  for (const row of rows) {
404
- const parsedManifest = parseManifest(JSON.parse(row.manifest));
404
+ const parsedManifest = parseManifest(parseJsonbField(row.manifest));
405
405
  const worker = getCollector(parsedManifest.name);
406
406
  if (!worker) {
407
407
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_collect",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Collector-manager engine for the Ocdata platform",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",