Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Bug regarding getChangedFields and hasChanged

when you use snapshots there is a bug with null fields. It says fields doesn't changed when value is changed from null to 0. Values are compared with == not with ===. tested on 2.1 and 3.0.3 on both versions it says field doen't changed

edited 9d ago

On line 3904 of

if value != snapshot[name] {

it should be something like:

if value !== snapshot[name] {

or even it should be checked if its changed fromm null or from '' to 0 and return true and return false when from 0 to '0'