Commit 6d0a91a
committed
fix(db): account for cursor and offset in isPredicateSubset deduplication
The DeduplicatedLoadSubset class was not considering cursor or offset when
checking if a request could be deduplicated. This could lead to incorrect
deduplication where requests loading different pages were treated as duplicates.
Changes:
- Update isPredicateSubset to check cursor.lastKey for cursor-based pagination
- Update isPredicateSubset to check offset ranges for offset-based pagination
- Update test expectations to reflect correct deduplication behavior
- Remove accidental .only modifier in pagination e2e tests
- Remove unused 'or' import from electric.ts1 parent 35fcc2c commit 6d0a91a
File tree
4 files changed
+91
-29
lines changed- packages
- db-collection-e2e/src/suites
- db/src/query
- electric-db-collection
- src
- tests
4 files changed
+91
-29
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
418 | 420 | | |
419 | 421 | | |
420 | 422 | | |
| |||
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| 438 | + | |
| 439 | + | |
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
440 | 444 | | |
| 445 | + | |
| 446 | + | |
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
| |||
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
| 455 | + | |
| 456 | + | |
449 | 457 | | |
450 | 458 | | |
451 | 459 | | |
452 | 460 | | |
| 461 | + | |
| 462 | + | |
453 | 463 | | |
454 | 464 | | |
455 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
| 788 | + | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
805 | 840 | | |
806 | 841 | | |
807 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
402 | 417 | | |
403 | | - | |
404 | | - | |
405 | 418 | | |
406 | 419 | | |
407 | | - | |
| 420 | + | |
| 421 | + | |
408 | 422 | | |
409 | 423 | | |
410 | | - | |
| 424 | + | |
411 | 425 | | |
412 | 426 | | |
413 | | - | |
| 427 | + | |
| 428 | + | |
414 | 429 | | |
415 | 430 | | |
416 | 431 | | |
| |||
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
879 | | - | |
880 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
881 | 882 | | |
882 | 883 | | |
883 | 884 | | |
| |||
1186 | 1187 | | |
1187 | 1188 | | |
1188 | 1189 | | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1192 | 1194 | | |
1193 | 1195 | | |
1194 | 1196 | | |
| |||
1198 | 1200 | | |
1199 | 1201 | | |
1200 | 1202 | | |
1201 | | - | |
1202 | | - | |
| 1203 | + | |
| 1204 | + | |
1203 | 1205 | | |
1204 | 1206 | | |
1205 | 1207 | | |
| |||
1217 | 1219 | | |
1218 | 1220 | | |
1219 | 1221 | | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1223 | 1225 | | |
1224 | 1226 | | |
1225 | 1227 | | |
| |||
0 commit comments