Page MenuHomePhabricator

[lib/web/native] implement asserting store after processing ops for both web and native
ClosedPublic

Authored by kamil on Nov 8 2023, 5:01 AM.
Tags
None
Referenced Files
F5336018: D9761.id33332.diff
Wed, Apr 9, 12:02 AM
F5314070: D9761.id.diff
Tue, Apr 8, 3:49 PM
Unknown Object (File)
Tue, Mar 25, 3:28 PM
Unknown Object (File)
Mon, Mar 17, 8:06 PM
Unknown Object (File)
Mon, Mar 17, 8:06 PM
Unknown Object (File)
Mon, Mar 17, 8:06 PM
Unknown Object (File)
Mon, Mar 17, 8:06 PM
Unknown Object (File)
Mon, Mar 17, 8:06 PM
Subscribers

Details

Summary

This is a pattern we used in the past, but now I want to make it work on all platforms.

Depends on D9759

Test Plan

Call assertUserStoresAreEqual and check the result:
web:

image.png (648×958 px, 116 KB)

native:
image.png (1×828 px, 654 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Nov 8 2023, 5:44 AM
kamil added inline comments.
lib/reducers/user-reducer.js
139 ↗(On Diff #32938)

UserStore here is probably redundant (look at screenshots)

149 ↗(On Diff #32938)

I'll remove those in the next diff (here and line 125)

lib/utils/objects.js
122 ↗(On Diff #32938)

it's safe, we don't call this function anywhere (in code before this diff), in this diff it's handled properly

native/redux/redux-debug-utils.js
6 ↗(On Diff #32938)

I use this, not native/utils/alert.js on purpose.

This code can be called from the reducer, our own Alert calls store.getState() which cause crashes

This revision is now accepted and ready to land.Nov 8 2023, 6:21 AM