Page MenuHomePhabricator

[lib] generate message store ops for threads after sending message
ClosedPublic

Authored by kamil on Apr 13 2023, 7:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 4:21 AM
Unknown Object (File)
Tue, Nov 5, 4:20 AM
Unknown Object (File)
Thu, Oct 31, 11:43 AM
Unknown Object (File)
Oct 13 2024, 2:57 AM
Unknown Object (File)
Oct 7 2024, 1:45 PM
Unknown Object (File)
Oct 1 2024, 12:00 PM
Unknown Object (File)
Oct 1 2024, 12:00 PM
Unknown Object (File)
Oct 1 2024, 12:00 PM
Subscribers

Details

Summary

This code generates operations needed for updating threads part of message store after message was sent with success.

Depends on D7417

Test Plan

Try to send message (with success) using different flows on both web and native

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Apr 13 2023, 8:28 AM
tomek added inline comments.
lib/reducers/message-reducer.js
1248 ↗(On Diff #25107)
1256 ↗(On Diff #25107)

Does it make sense to spread it here?

1267–1270 ↗(On Diff #25107)

Shouldn't we use processedMessageStore.threads or something?

This revision is now accepted and ready to land.Apr 17 2023, 5:36 AM

remove spread operator and rebase

lib/reducers/message-reducer.js
1248 ↗(On Diff #25107)

I don't think that's a good change, single thread is what's defined by threadID key, this object:

{
        ...messageStore.threads[threadID],
        messageIDs: newMessageIDs,
},

This right here is the threads object (but I agree it will have one key).
With this change later I will have to use: payload: { threads: updatedThread }, which I think is more confusing.

1256 ↗(On Diff #25107)

looks like not - thanks for pointing

1267–1270 ↗(On Diff #25107)