@pylonsync/sync 0.3.347 → 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.
- package/package.json +1 -1
- package/src/index.ts +6 -2
package/package.json
CHANGED
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;
|