@syncular/server 0.70.0 → 0.70.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.
@@ -2275,7 +2275,7 @@ FOR EACH ROW EXECUTE FUNCTION syncular_writer_fence()`,
2275
2275
  LEFT JOIN sync_commits m ON m.partition=$1 AND m.commit_seq=c.commit_seq
2276
2276
  LEFT JOIN LATERAL (SELECT k.i AS key,
2277
2277
  sum(coalesce(octet_length(ch.payload), 0) + octet_length(ch.row_id) + octet_length(ch.scopes::text)) AS bytes
2278
- FROM sync_changes ch JOIN k ON ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND ch.scopes->>k.var=k.value
2278
+ FROM sync_changes ch JOIN k ON ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND (CASE jsonb_typeof(ch.scopes) WHEN 'string' THEN (ch.scopes#>>'{}')::jsonb ELSE ch.scopes END)->>k.var=k.value
2279
2279
  WHERE ch.partition=$1 AND ch.commit_seq=c.commit_seq
2280
2280
  GROUP BY k.i) z ON true
2281
2281
  ORDER BY c.commit_seq, z.key`, [partition, JSON.stringify(keys), query.throughSeq, limit]);
@@ -2299,7 +2299,7 @@ FOR EACH ROW EXECUTE FUNCTION syncular_writer_fence()`,
2299
2299
  ch.row_version AS row_version, ch.scopes AS scopes, ch.payload AS payload
2300
2300
  FROM sync_changes ch
2301
2301
  WHERE ch.partition=$1 AND ch.commit_seq>$3 AND ch.commit_seq<=$4
2302
- AND EXISTS (SELECT 1 FROM k WHERE ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND ch.scopes->>k.var=k.value)
2302
+ AND EXISTS (SELECT 1 FROM k WHERE ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND (CASE jsonb_typeof(ch.scopes) WHEN 'string' THEN (ch.scopes#>>'{}')::jsonb ELSE ch.scopes END)->>k.var=k.value)
2303
2303
  ORDER BY ch.commit_seq, ch.idx`, [partition, JSON.stringify(keys), after, through]);
2304
2304
  return rows.map((record) => ({
2305
2305
  commitSeq: asNumber(record.commit_seq),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/server",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "description": "Syncular server: handleSyncRequest + storage/auth interfaces for the sync protocol",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -68,7 +68,7 @@
68
68
  "verify:node": "cd ../.. && bun build ./packages/server/test/sqlite-runtime/verify-node.mjs --target=node --conditions=bun --outfile=./packages/server/.verify-node.built.mjs && node ./packages/server/.verify-node.built.mjs"
69
69
  },
70
70
  "dependencies": {
71
- "@syncular/core": "0.70.0"
71
+ "@syncular/core": "0.70.2"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@electric-sql/pglite": "^0.5.4"
@@ -3345,7 +3345,7 @@ FOR EACH ROW EXECUTE FUNCTION syncular_writer_fence()`,
3345
3345
  LEFT JOIN sync_commits m ON m.partition=$1 AND m.commit_seq=c.commit_seq
3346
3346
  LEFT JOIN LATERAL (SELECT k.i AS key,
3347
3347
  sum(coalesce(octet_length(ch.payload), 0) + octet_length(ch.row_id) + octet_length(ch.scopes::text)) AS bytes
3348
- FROM sync_changes ch JOIN k ON ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND ch.scopes->>k.var=k.value
3348
+ FROM sync_changes ch JOIN k ON ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND (CASE jsonb_typeof(ch.scopes) WHEN 'string' THEN (ch.scopes#>>'{}')::jsonb ELSE ch.scopes END)->>k.var=k.value
3349
3349
  WHERE ch.partition=$1 AND ch.commit_seq=c.commit_seq
3350
3350
  GROUP BY k.i) z ON true
3351
3351
  ORDER BY c.commit_seq, z.key`,
@@ -3375,7 +3375,7 @@ FOR EACH ROW EXECUTE FUNCTION syncular_writer_fence()`,
3375
3375
  ch.row_version AS row_version, ch.scopes AS scopes, ch.payload AS payload
3376
3376
  FROM sync_changes ch
3377
3377
  WHERE ch.partition=$1 AND ch.commit_seq>$3 AND ch.commit_seq<=$4
3378
- AND EXISTS (SELECT 1 FROM k WHERE ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND ch.scopes->>k.var=k.value)
3378
+ AND EXISTS (SELECT 1 FROM k WHERE ch.commit_seq>k.after AND k.tables @> to_jsonb(ch.tbl) AND (CASE jsonb_typeof(ch.scopes) WHEN 'string' THEN (ch.scopes#>>'{}')::jsonb ELSE ch.scopes END)->>k.var=k.value)
3379
3379
  ORDER BY ch.commit_seq, ch.idx`,
3380
3380
  [partition, JSON.stringify(keys), after, through],
3381
3381
  );