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
F3652766: D9761.id32938.diff
Sun, Jan 5, 8:17 AM
F3652758: D9761.id33287.diff
Sun, Jan 5, 8:16 AM
F3652747: D9761.id33006.diff
Sun, Jan 5, 8:16 AM
F3652745: D9761.id33332.diff
Sun, Jan 5, 8:16 AM
F3649181: D9761.id.diff
Sun, Jan 5, 4:24 AM
Unknown Object (File)
Tue, Dec 31, 6:30 AM
Unknown Object (File)
Tue, Dec 31, 6:30 AM
Unknown Object (File)
Tue, Dec 31, 6:30 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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