Commit f443834
Bug/server 6899/embedded document increment (#1219)
* Add further complexity to test cases when documents changed
A bug has been identified when we attempt to increment a value in an embedded
document. This could potentially be missed by the current tests because they
only have a document with a single value and that is the value that is updated.
This commit adds a second property to the embedded document and ensures it is
still present after the various function calls
* Add tests that demonstrate the issue with incrementing embedded doc
Once the object is saved, the response from the save only returns the updated
properties on the embedded document. This is then used to REPLACE the embedded
document instead of being merged with it. This is incorrect if the operation
was an Increment/Decrement/Add
* Attempt to resolve embedded document increment bug
This change resolves the system when we use it in our code... however it does
NOT result in the new tests that were created passing. I am a little confused
by that.
* Adjust handleSaveResponse conditional handling.
Only certain types of objects should be merged using Javascript spread operator.
Previous attempt was including Dates... which fails
* _handleSaveResponse: Merge response value with original attributes for nested objects
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
Co-authored-by: Robby Helms <robby@pocketprep.com>1 parent e155079 commit f443834
File tree
4 files changed
+76
-8
lines changed- integration/test
- src
- __tests__
4 files changed
+76
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
258 | 279 | | |
259 | 280 | | |
260 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| 614 | + | |
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | | - | |
| 620 | + | |
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
626 | | - | |
| 627 | + | |
627 | 628 | | |
628 | 629 | | |
629 | 630 | | |
| |||
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
637 | 676 | | |
638 | 677 | | |
639 | 678 | | |
| |||
0 commit comments