Skip to content

Duplication of entire / partial cache object in MMKV storage #500

Open
@vaibhav-toddleapp

Description

In case of MMKV storage, it doesn’t check for key duplication, and just appends the key-value pair even if key is duplicated. So, our cache object will be saved with duplicate data every time cache object gets updated ( in 'write' trigger ).

For example, lets say first query named getUser is called and persisted in MMKV storage then internally file will look like this:
key_given_in_persist_constructor :: { ROOT_QUERY: { getUser: {......} } }

further on lets say we call another query getUserTasks then now file will look like this:
key_given_in_persist_constructor :: { ROOT_QUERY: { getUser: {......} } }
key_given_in_persist_constructor :: { ROOT_QUERY: { getUser: {......}, getUserTasks: {.......} } }

ignore cache object structure, it is for understanding purpose*

Correct me if i am wrong/misunderstood something.

And if it is correct then we should mention this in documentation and if possible alter some behaviour as well.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions