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
Unknown Object (File)
Sun, Nov 24, 6:19 PM
Unknown Object (File)
Mon, Nov 18, 9:55 AM
Unknown Object (File)
Mon, Nov 18, 9:24 AM
Unknown Object (File)
Fri, Nov 8, 7:42 AM
Unknown Object (File)
Fri, Nov 8, 7:39 AM
Unknown Object (File)
Fri, Nov 8, 1:10 AM
Unknown Object (File)
Fri, Nov 8, 12:51 AM
Unknown Object (File)
Fri, Nov 8, 12:36 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