Commit c182c93
fix: Ensure hard-delete mode doesn't delete data it shouldn't when
## What hard delete was previously doing wrong
As discussed in
#340, hard delete
deleted data that it shouldn't. This was caused by a `<=` where there
should have been a `<`.
## So why were the tests passing?
All ACTIVATE_VERSION messages were run before any records were synced.
This is because RECORD messages were being batched until the end of the
sync, whereas ACTIVATE_VERSION messages were processed as they arrived.
The intent of `test_activate_version_hard_delete` was to:
1. Sync seven records
2. Check that seven records were synced
3. Add two records "manually"
4. Check that there are nine records in total
5. Sync the same seven records, with ACTIVATE_VERSION removing the two
manual records.
6. Check that seven records remain
Here's what was really happening:
1. Sync seven records
2. Seven records were synced? ✅
3. Add two records "manually"
4. There are nine records in total? ✅
5. ACTIVATE_VERSION deletes all nine records and then syncs the same
seven records again.
6. Seven records remain? ACTIVATE_VERSION messages are processed (#391)1 parent a72feb2 commit c182c93
File tree
4 files changed
+20
-10
lines changed- target_postgres
- tests
- data_files
4 files changed
+20
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
327 | 336 | | |
328 | 337 | | |
329 | 338 | | |
| |||
370 | 379 | | |
371 | 380 | | |
372 | 381 | | |
373 | | - | |
| 382 | + | |
374 | 383 | | |
375 | 384 | | |
376 | 385 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
637 | | - | |
638 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| |||
0 commit comments