Changeset View
Standalone View
native/redux/persist.js
Show First 20 Lines • Show All 527 Lines • ▼ Show 20 Lines | try { | ||||
return { ...state, cookie: null }; | return { ...state, cookie: null }; | ||||
} | } | ||||
return state; | return state; | ||||
}, | }, | ||||
[38]: state => | [38]: state => | ||||
updateClientDBThreadStoreThreadInfos(state, updateRolesAndPermissions), | updateClientDBThreadStoreThreadInfos(state, updateRolesAndPermissions), | ||||
[39]: (state: AppState) => unshimClientDB(state, [messageTypes.EDIT_MESSAGE]), | [39]: (state: AppState) => unshimClientDB(state, [messageTypes.EDIT_MESSAGE]), | ||||
[40]: (state: AppState) => ({ | |||||
kamil: At this point, the state is not a type of `AppState`, because it does not have required prop… | |||||
tomekAuthorUnsubmitted Done Inline ActionsThat's true, but following this convention is convenient. tomek: That's true, but following this convention is convenient. | |||||
...state, | |||||
inviteLinksStore: { | |||||
links: {}, | |||||
}, | |||||
}), | |||||
}; | }; | ||||
kamilUnsubmitted Not Done Inline Actionsare you sure this is needed? I think we use by default autoMergeLevel1 - so rehydrated state should be merged with the initial state, and this will have no effect anyway. kamil: are you sure this is needed?
I think we use by default [autoMergeLevel1](https://github. | |||||
tomekAuthorUnsubmitted Done Inline ActionsInteresting. I added it after some errors I've seen. I can test and remove if not necessary, but also I'm not sure if spending too much time on it makes sense. tomek: Interesting. I added it after some errors I've seen. I can test and remove if not necessary… | |||||
tomekAuthorUnsubmitted Done Inline ActionsI've tested it by:
tomek: I've tested it by:
1. Checking out a version before this migration was introduced
2. Wiping out… | |||||
kamilUnsubmitted Not Done Inline Actions
Not sure what exactly errors you saw, but I suspect that it was an alert saying that EXPECTED KEYS NOT REHYDRATED: ["inviteLinksStore"], this should be shown only once and I don't think it's a problem - just logging that there is a new key in the default store, not persisted yet. kamil: > Interesting. I added it after some errors I've seen.
Not sure what exactly errors you saw… | |||||
tomekAuthorUnsubmitted Done Inline ActionsNo, these were exceptions saying something like "cannot read property links of undefined". But maybe they were connected to requests and not the state. tomek: No, these were exceptions saying something like "cannot read property `links` of undefined". | |||||
// After migration 31, we'll no longer want to persist `messageStore.messages` | // After migration 31, we'll no longer want to persist `messageStore.messages` | ||||
// via redux-persist. However, we DO want to continue persisting everything in | // via redux-persist. However, we DO want to continue persisting everything in | ||||
// `messageStore` EXCEPT for `messages`. The `blacklist` property in | // `messageStore` EXCEPT for `messages`. The `blacklist` property in | ||||
// `persistConfig` allows us to specify top-level keys that shouldn't be | // `persistConfig` allows us to specify top-level keys that shouldn't be | ||||
// persisted. However, we aren't able to specify nested keys in `blacklist`. | // 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 | // 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 | // need to use `createTransform(...)` to specify an `inbound` function that | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |
At this point, the state is not a type of AppState, because it does not have required prop inviteLinksStore.
In other migrations this thing is common so probably it's okay - just it doesn't feel correct to me.