Skip to content

[cloud_firestore] DocumentSnapshot data should be immutable #2007

Closed
@collinjackson

Description

@collinjackson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssue with no recent activityimpact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: cloud_firestoretype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions