issue: https://linear.app/comm/issue/ENG-4457/refactor-sessionid-field
Removing sessionID redux field. It is now replaced by sessionID in keyserverStore
Details
Details
ran yarn flow-all.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
lib/types/keyserver-types.js | ||
---|---|---|
15 ↗ | (On Diff #29140) | This comment was moved from redux-types.js |
lib/utils/sanitization.js | ||
310 ↗ | (On Diff #29140) | this fixes Could not decide which case to select, since case 1 [1] may work but if it doesn't case 2 [2] looks promising too. To fix add a type annotation to `keyserverStore` [3].Flow(speculation-ambiguous) appearing in line 315 |
318 ↗ | (On Diff #29140) | Cannot assign object literal to `state` because undefined [1] is incompatible with null or undefined [2] in property `sessionID` of type argument `KeyserverInfoType` [3] of property `keyserverStore`.Flow(incompatible-type) It's very odd that an error appears after a different field is removed... and in a different type then those the error is related to... |
Comment Actions
Heads-up, it looks like you've not specified any reviewers
lib/utils/sanitization.js | ||
---|---|---|
318 ↗ | (On Diff #29140) | What happens if you do something like this: if (state.sessionID) { state = { ...state, deviceToken: null }; } else { state = { ...state, deviceToken: null }; } |
lib/utils/sanitization.js | ||
---|---|---|
318 ↗ | (On Diff #29140) | It sadly doesn't help Cannot assign object literal to `state` because undefined [1] is incompatible with null or undefined [2] in property `sessionID` of type argument `KeyserverInfoType` [3] of property `keyserverStore`.Flow(incompatible-type) And since sessionID is now in keyserverStore, the code would be quite horrible if ( state.keyserverStore.keyserverInfos[ Object.keys(state.keyserverStore.keyserverInfos)[0] ].sessionID ) |
lib/types/keyserver-types.js | ||
---|---|---|
15 ↗ | (On Diff #29293) | Nit: shouldn't this go above NativeKeyserverInfo? |