issue: https://linear.app/comm/issue/ENG-5284/refactor-setdevicetoken-action
I split the action into two actions to spare the calling code having to select all keyservers when it simply wants to call all of them
Details
tested that both action work, tested that
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/chat/reaction-message-utils.js | ||
---|---|---|
63–72 ↗ | (On Diff #32493) | Same as below Could not decide which case to select, since case 112 [1] may work but if it doesn't case 127 [1] looks promising too. To fix add a type annotation to `result.interface` [2], to `result.time` [3], or to `result.server.id` [4].Flow(speculation-ambiguous) action-utils.js(117, 20): [1] case 112 action-utils.js(117, 20): [1] case 127 reaction-message-utils.js(72, 24): [2] to `result.interface` reaction-message-utils.js(71, 19): [3] to `result.time` reaction-message-utils.js(69, 23): [4] to `result.server.id` |
72 ↗ | (On Diff #32493) | Interface is a special keyword, cannot create a variable named this way |
web/modals/history/history-modal.react.js | ||
221–222 ↗ | (On Diff #32493) | Flow was showing some errors about not being able to tell the type... Could not decide which case to select, since case 112 [1] may work but if it doesn't case 156 [1] looks promising too. To fix add a type annotation to `result[0].deleted` [2] or to `result[0].text` [3].Flow(speculation-ambiguous) action-utils.js(117, 20): [1] case 112 action-utils.js(117, 20): [1] case 156 history-modal.react.js(226, 16): [2] to `result[0].deleted` history-modal.react.js(225, 13): [3] to `result[0].text` |
web/modals/history/history-modal.react.js | ||
---|---|---|
221–222 ↗ | (On Diff #32493) | This error means that Flow can't decide what is the type, and fixing it is different for each case. In this case, it seems to be caused by the fact that a payload of action is DeviceTokens which is an object mapping from any string to a string, so it is a supertype of some other payloads. I think we can solve the issue by modifying SET_DEVICE_TOKEN_SUCCESS action payload to be a new type, e.g. SetDeviceTokensPayload = { +deviceTokes: DeviceTokens } |
web/modals/history/history-modal.react.js | ||
---|---|---|
221–222 ↗ | (On Diff #32493) | Thank you!! |
native/push/push-handler.react.js | ||
---|---|---|
443 ↗ | (On Diff #32637) | Will fix |
lib/actions/device-actions.js | ||
---|---|---|
29 | There's a type error here. DeviceTokens points to a value that is nullable, but DeviceTokenUpdateRequest requires deviceToken to be specified The validator for the type (deviceTokenUpdateRequestInputValidator) appears to allow for a nullable deviceToken, so maybe the type (DeviceTokenUpdateRequest) should be updated so that deviceToken is nullable there too? |