Closed
Description
In the past it was possible to mutate the data
member of a DocumentSnapshot
and it would persist. Developers were relying on this behavior (see discussion here).
We could make the data returned by DocumentSnapshot
immutable to give a clear error to developers letting them know that mutations aren't supported instead of silently failing. This would also reduce the risk of unpredictable behavior when different parts of the code are mutating the same data map.
For bonus points we could lazily convert the maps and cache the result to avoid unnecessary computation.