@powersync/service-module-mongodb-storage 0.0.0-dev-20250507151436 → 0.0.0-dev-20250611110033
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/CHANGELOG.md +43 -6
- package/dist/storage/MongoBucketStorage.js +1 -0
- package/dist/storage/MongoBucketStorage.js.map +1 -1
- package/dist/storage/implementation/MongoBucketBatch.d.ts +9 -3
- package/dist/storage/implementation/MongoBucketBatch.js +82 -30
- package/dist/storage/implementation/MongoBucketBatch.js.map +1 -1
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.d.ts +1 -0
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.js +2 -0
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.js.map +1 -1
- package/dist/storage/implementation/MongoSyncBucketStorage.js +26 -4
- package/dist/storage/implementation/MongoSyncBucketStorage.js.map +1 -1
- package/dist/storage/implementation/PersistedBatch.d.ts +6 -2
- package/dist/storage/implementation/PersistedBatch.js +39 -7
- package/dist/storage/implementation/PersistedBatch.js.map +1 -1
- package/dist/storage/implementation/models.d.ts +12 -0
- package/package.json +9 -10
- package/src/storage/MongoBucketStorage.ts +1 -0
- package/src/storage/implementation/MongoBucketBatch.ts +114 -41
- package/src/storage/implementation/MongoPersistedSyncRulesContent.ts +2 -0
- package/src/storage/implementation/MongoSyncBucketStorage.ts +26 -4
- package/src/storage/implementation/PersistedBatch.ts +50 -11
- package/src/storage/implementation/models.ts +15 -1
- package/test/src/__snapshots__/storage_sync.test.ts.snap +147 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -309,6 +309,153 @@ exports[`sync - mongodb > sync global data 1`] = `
|
|
|
309
309
|
]
|
|
310
310
|
`;
|
|
311
311
|
|
|
312
|
+
exports[`sync - mongodb > sync interrupts low-priority buckets on new checkpoints (2) 1`] = `
|
|
313
|
+
[
|
|
314
|
+
{
|
|
315
|
+
"checkpoint": {
|
|
316
|
+
"buckets": [
|
|
317
|
+
{
|
|
318
|
+
"bucket": "b0a[]",
|
|
319
|
+
"checksum": -659831575,
|
|
320
|
+
"count": 2000,
|
|
321
|
+
"priority": 2,
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"bucket": "b0b[]",
|
|
325
|
+
"checksum": -659831575,
|
|
326
|
+
"count": 2000,
|
|
327
|
+
"priority": 2,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"bucket": "b1[]",
|
|
331
|
+
"checksum": -1096116670,
|
|
332
|
+
"count": 1,
|
|
333
|
+
"priority": 1,
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
"last_op_id": "4001",
|
|
337
|
+
"write_checkpoint": undefined,
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"data": {
|
|
342
|
+
"after": "0",
|
|
343
|
+
"bucket": "b1[]",
|
|
344
|
+
"data": undefined,
|
|
345
|
+
"has_more": false,
|
|
346
|
+
"next_after": "1",
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"partial_checkpoint_complete": {
|
|
351
|
+
"last_op_id": "4001",
|
|
352
|
+
"priority": 1,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"data": {
|
|
357
|
+
"after": "0",
|
|
358
|
+
"bucket": "b0a[]",
|
|
359
|
+
"data": undefined,
|
|
360
|
+
"has_more": true,
|
|
361
|
+
"next_after": "2000",
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"data": {
|
|
366
|
+
"after": "2000",
|
|
367
|
+
"bucket": "b0a[]",
|
|
368
|
+
"data": undefined,
|
|
369
|
+
"has_more": true,
|
|
370
|
+
"next_after": "4000",
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"checkpoint_diff": {
|
|
375
|
+
"last_op_id": "4004",
|
|
376
|
+
"removed_buckets": [],
|
|
377
|
+
"updated_buckets": [
|
|
378
|
+
{
|
|
379
|
+
"bucket": "b0a[]",
|
|
380
|
+
"checksum": 883076828,
|
|
381
|
+
"count": 2001,
|
|
382
|
+
"priority": 2,
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"bucket": "b0b[]",
|
|
386
|
+
"checksum": 883076828,
|
|
387
|
+
"count": 2001,
|
|
388
|
+
"priority": 2,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"bucket": "b1[]",
|
|
392
|
+
"checksum": 1841937527,
|
|
393
|
+
"count": 2,
|
|
394
|
+
"priority": 1,
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
"write_checkpoint": undefined,
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"data": {
|
|
402
|
+
"after": "1",
|
|
403
|
+
"bucket": "b1[]",
|
|
404
|
+
"data": undefined,
|
|
405
|
+
"has_more": false,
|
|
406
|
+
"next_after": "4002",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"partial_checkpoint_complete": {
|
|
411
|
+
"last_op_id": "4004",
|
|
412
|
+
"priority": 1,
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"data": {
|
|
417
|
+
"after": "4000",
|
|
418
|
+
"bucket": "b0a[]",
|
|
419
|
+
"data": undefined,
|
|
420
|
+
"has_more": false,
|
|
421
|
+
"next_after": "4003",
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"data": {
|
|
426
|
+
"after": "0",
|
|
427
|
+
"bucket": "b0b[]",
|
|
428
|
+
"data": undefined,
|
|
429
|
+
"has_more": true,
|
|
430
|
+
"next_after": "1999",
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"data": {
|
|
435
|
+
"after": "1999",
|
|
436
|
+
"bucket": "b0b[]",
|
|
437
|
+
"data": undefined,
|
|
438
|
+
"has_more": true,
|
|
439
|
+
"next_after": "3999",
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"data": {
|
|
444
|
+
"after": "3999",
|
|
445
|
+
"bucket": "b0b[]",
|
|
446
|
+
"data": undefined,
|
|
447
|
+
"has_more": false,
|
|
448
|
+
"next_after": "4004",
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"checkpoint_complete": {
|
|
453
|
+
"last_op_id": "4004",
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
]
|
|
457
|
+
`;
|
|
458
|
+
|
|
312
459
|
exports[`sync - mongodb > sync legacy non-raw data 1`] = `
|
|
313
460
|
[
|
|
314
461
|
{
|