Fix regression for merge with increment by schmidt-sebastian · Pull Request #3048 · firebase/firebase-js-sdk (original) (raw)

This reverts a behavior change in #3001

Before this PR, the parse contexts we used to parse ArrayTransform and Increment values was detached from the original parse context that was used to parse the update. Thus, setting the field path for the value that was being incremented did not end up modifying the context that was used to generate the Proto. The result of this was { updateMask: [] }. By removing the copy, we ended up with { updateMask: ['sum'] }, which ended up rewriting the value before applying the increment.

Fixes #3045