HomePhabricator
Diffusion Comm bc4f14cb5e95

[lib] Fix state check with new ID schema

Description

[lib] Fix state check with new ID schema

Summary:
https://linear.app/comm/issue/ENG-245/make-sure-state-sync-mechanism-works-after-client-id-migration
There was bug in the id schema conversion during the state check. The async function returned by the getClientResponsesSelector modified the arguments gotten from the input selectors. That meant if the async function was called multiple times (and redux state didn't change so it wasn't regenerated) it would try to convert the already converted state. This diff moves the conversion outside of the async function so it's done only once.

Test Plan: Check that if the state sync runs for the second time without redux changes no errors are thrown. (that was what was triggering the errors without this diff)

Reviewers: kamil, tomek

Reviewed By: kamil

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D8356

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Jun 27 2023, 8:57 AM
Reviewer
kamil
Differential Revision
D8356: [lib] Fix state check with new ID schema
Parents
rCOMM31b35e4732a6: [lib] Generate converters from validators
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMMbc4f14cb5e95: [lib] Fix state check with new ID schema (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Jul 13 2023, 2:16 AM