Page MenuHomePhabricator

[web] refactor validateState to operations
ClosedPublic

Authored by kamil on Nov 22 2023, 8:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 30, 2:52 AM
Unknown Object (File)
Sat, Sep 28, 9:30 PM
Unknown Object (File)
Sat, Sep 28, 9:30 PM
Unknown Object (File)
Sat, Sep 28, 9:30 PM
Unknown Object (File)
Sat, Sep 28, 9:30 PM
Unknown Object (File)
Sat, Sep 28, 9:25 PM
Unknown Object (File)
Aug 28 2024, 5:17 AM
Unknown Object (File)
Aug 28 2024, 5:15 AM
Subscribers

Details

Summary

This is similar to fixUnreadActiveThread on native.
Also moving processing ops to the end of reducer executions.

Depends on D9955

Test Plan
  1. Unread/read status works.
  2. Processing ops works.

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 23 2023, 3:18 AM
tomek requested changes to this revision.Nov 24 2023, 1:40 AM
tomek added inline comments.
web/redux/redux-setup.js
314–327 ↗(On Diff #33516)

Should we check if it is unread before pushing the op? Currently, it seems like we're going to create a new op every time we validate a state, which sounds wasteful.

365 ↗(On Diff #33516)

It doesn't sound like this call should be a part of the validate function. Maybe we can rename some functions or introduce new ones so that this processing isn't in a surprising place?

This revision now requires changes to proceed.Nov 24 2023, 1:40 AM
web/redux/redux-setup.js
314–327 ↗(On Diff #33516)

Doesn't line 311 perform this check? Or am I missing something?

web/redux/redux-setup.js
314–327 ↗(On Diff #33516)

Ah, yes, that makes sense!

rename

web/redux/redux-setup.js
365 ↗(On Diff #33516)

I think the cleanest will be to rename validateState -> validateStateAndProcessDBOperations

This revision is now accepted and ready to land.Nov 27 2023, 6:20 AM
This revision was landed with ongoing or failed builds.Nov 27 2023, 6:47 AM
This revision was automatically updated to reflect the committed changes.