Page MenuHomePhabricator

Implement ChangeThreadSubscriptionSpec and add ThreadSubscription to createThickRawThreadInfo
ClosedPublic

Authored by marcin on Wed, Aug 21, 9:47 AM.
Tags
None
Referenced Files
F2754013: D13132.id43796.diff
Wed, Sep 18, 6:41 PM
Unknown Object (File)
Mon, Sep 16, 1:17 PM
Unknown Object (File)
Sun, Sep 15, 8:36 PM
Unknown Object (File)
Sat, Sep 14, 12:24 PM
Unknown Object (File)
Thu, Sep 12, 1:53 PM
Unknown Object (File)
Sun, Sep 8, 6:54 PM
Unknown Object (File)
Sat, Sep 7, 2:19 PM
Unknown Object (File)
Fri, Sep 6, 11:53 PM
Subscribers

Details

Summary

This differential implements DMOperation and necessary spec for changing thread subscription. Additionally createThickRawThreadInfo is modified to accept information about subscription. This way users will get to now other members subscriptions when they are added or join the thread.

Test Plan
  1. Apply this patch: https://gist.github.com/marcinwasowicz/e0e48311f76df2acbacd0ac59e888a9c
  2. Send message from one web user to another.
  3. Ensure that both have new thread in redux and the sender has non-default subscription.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
lib/shared/dm-ops/change-thread-subscription.js
67–73 ↗(On Diff #43552)

This is tricky because it is possible we haven't yet received an update about the viewer joining this thread, but the update should be processed later and is valid. We shouldn't throw it away. Added a comment to the relevant issue https://linear.app/comm/issue/ENG-9000/create-validators-and-their-conversion-functions#comment-fc572ece.

For now, I guess we can keep it as is.

lib/shared/dm-ops/create-thread-spec.js
107 ↗(On Diff #43552)
lib/types/dm-ops.js
55 ↗(On Diff #43552)
This revision is now accepted and ready to land.Wed, Aug 28, 6:24 AM
  1. Addres review
  2. Rebase before landing
lib/shared/dm-ops/dm-op-utils.js
176–179 ↗(On Diff #43796)

The fact that I had to do this suggests that ThreadSubscription should be passed from` ThickRawThreadInfo` to ThreadInfo.