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
F3176992: D9761.diff
Thu, Nov 7, 10:16 PM
Unknown Object (File)
Sun, Nov 3, 11:34 AM
Unknown Object (File)
Sun, Oct 27, 5:22 PM
Unknown Object (File)
Sat, Oct 26, 5:26 PM
Unknown Object (File)
Fri, Oct 11, 10:18 AM
Unknown Object (File)
Sep 28 2024, 9:30 PM
Unknown Object (File)
Sep 28 2024, 9:30 PM
Unknown Object (File)
Sep 28 2024, 9:30 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
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