@pylonsync/sync 0.3.346 → 0.3.348

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +6 -2
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.346",
6
+ "version": "0.3.348",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -2124,9 +2124,13 @@ export class SyncEngine {
2124
2124
  // 200 pages × 100 per page = 20k rows. A `sync:true` entity larger than
2125
2125
  // this should switch to `sync: false` + search/by-id — see useInfiniteQuery.
2126
2126
  for (let page = 0; page < 200; page++) {
2127
+ // `sync=1` marks this as a REPLICATION fetch, which is what makes an
2128
+ // entity's `sync` scope apply. Without it the server treats the request
2129
+ // as an ordinary app read and returns unscoped rows — correct for a
2130
+ // direct read, wrong here, since these rows land in the replica.
2127
2131
  const qs: string = cursor
2128
- ? `?limit=100&after=${encodeURIComponent(cursor)}`
2129
- : `?limit=100`;
2132
+ ? `?limit=100&sync=1&after=${encodeURIComponent(cursor)}`
2133
+ : `?limit=100&sync=1`;
2130
2134
  const resp: {
2131
2135
  data: Row[];
2132
2136
  next_cursor: string | null;