Page MenuHomePhabricator

[lib] Split change thread settings spec
ClosedPublic

Authored by tomek on Aug 12 2024, 7:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 9:25 PM
Unknown Object (File)
Wed, Nov 20, 9:24 PM
Unknown Object (File)
Sat, Nov 9, 5:07 PM
Unknown Object (File)
Fri, Nov 8, 11:06 PM
Unknown Object (File)
Fri, Nov 8, 12:23 PM
Unknown Object (File)
Sun, Nov 3, 5:43 AM
Unknown Object (File)
Thu, Oct 31, 11:52 AM
Unknown Object (File)
Oct 22 2024, 1:16 PM
Subscribers

Details

Summary

Avoid sending unnecessary data and simplify the spec logic.

https://linear.app/comm/issue/ENG-8929/split-add-members-operation

Depends on D13052

Test Plan

Checked two scenarios:

  1. Viewer creates a thread and adds a new user to it using change_thread_settings operation
  2. Viewer is added to a thread using change_thread_settings_and_add_viewer operation

In both cases the thread appeared in the store with correct membership array.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Aug 12 2024, 8:55 AM
lib/shared/dm-ops/add-members-spec.js
27–28 ↗(On Diff #43313)

What's the point of making the field read-only if the value isn't?

inka added inline comments.
lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js
14 ↗(On Diff #43313)

Can we call it createAddViewerOperation? or createAddViewerToThreadOperation

33 ↗(On Diff #43313)

Can we merge this with the function above?

This revision is now accepted and ready to land.Aug 19 2024, 5:56 AM
lib/shared/dm-ops/add-members-spec.js
27–28 ↗(On Diff #43313)

Right, this isn't too useful.

lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js
14 ↗(On Diff #43313)

Renamed to createAddViewerAndMembersOperation because there might be more users that get added.

33 ↗(On Diff #43313)

We can't because createAddMembersOperation is used in canBeProcessed.

This revision was automatically updated to reflect the committed changes.