Page MenuHomePhabricator

Implement drafts persistence on web
ClosedPublic

Authored by marcin on Nov 21 2022, 5:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:21 PM
Unknown Object (File)
Tue, Nov 19, 2:11 PM
Unknown Object (File)
Wed, Nov 13, 4:38 AM
Subscribers

Details

Summary

This differential implements draft persistence on web via redux persist.

Test Plan

Before this differential is applied: Write a message, but do not send( draft). Reload web app. Draft will disappear. After this differential is applied: Write draft, reload web application. Draft should remain.
Open web app and native app, logged as the same client. Start creating sidebar by typing draft on web. Create the same sidebar on native. Draft on web should remain even after window reload.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/input/input-state-container.react.js
126 ↗(On Diff #18665)

I think we should remove this from state, it's not clear to me why we're keeping two in-memory stores for this

web/input/input-state-container.react.js
126 ↗(On Diff #18665)

We use it to create input state selector, where we rely on state.drafts.

web/input/input-state-container.react.js
126 ↗(On Diff #18665)

Address that please

web/input/input-state-container.react.js
126 ↗(On Diff #18665)

git grep PropsAndState

ashoat requested changes to this revision.Nov 21 2022, 6:05 AM
This revision now requires changes to proceed.Nov 21 2022, 6:05 AM

Remove redundant 'drafts' field from 'State'

ashoat requested changes to this revision.Nov 21 2022, 8:26 AM
ashoat added inline comments.
web/input/input-state-container.react.js
152–155 ↗(On Diff #18683)

Do we still need to be doing this here? Please make sure you understand what getDerivedStateFromProps was doing for the state.drafts state, and make sure it's still happening the same way now that drafts are in Redux. I think this diff breaks that functionality currently

This revision now requires changes to proceed.Nov 21 2022, 8:26 AM

Use ThreadDraftUpdater on web

ashoat added inline comments.
web/chat/chat.react.js
15–18 ↗(On Diff #18752)

I would move this below all of the use declarations

This revision is now accepted and ready to land.Nov 23 2022, 7:22 AM
This revision was automatically updated to reflect the committed changes.