HomePhabricator
Diffusion Comm 68dfad5fd41e

[native] Introduce `messageStoreMessagesBlocklistTransform`

Description

[native] Introduce messageStoreMessagesBlocklistTransform

Summary: After migration 31, we'll no longer want to persist messageStore.messages via redux-persist. However, we DO want to continue persisting everything in messageStore EXCEPT for messages. The blacklist property in persistConfig allows us to specify top-level keys that shouldn't be persisted. However, we aren't able to specify nested keys in blacklist. As a result, if we want to prevent nested keys from being persisted we'll need to use createTransform(...) to specify an inbound function that allows us to modify the state object before it's passed through JSON.stringify(...) and written to disk. We specify the keys for which this transformation should be executed in the whitelist property of the config object that's passed to createTransform(...).

Test Plan:
Included this transform in persistConfig and completed the migration to version: 31 without issue.

Will be more thorough and look at Redux dev tools/REHYDRATE action/etc. before landing this diff.

Reviewers: def-au1t, palys-swm, marcinwasowicz

Reviewed By: palys-swm

Subscribers: ashoat, Adrian, yayabosh

Differential Revision: https://phabricator.ashoat.com/D4170

Details

Provenance
atulAuthored on May 31 2022, 11:08 AM
Reviewer
tomek
Differential Revision
D4170: [native] Introduce `messageStoreMessagesBlocklistTransform`
Parents
rCOMM5049b82aab57: Merge pull request #171 from CommE2E/dependabot/npm_and_yarn/eventsource-1.1.1
Branches
Unknown
Tags
Unknown