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)
Sun, Nov 3, 5:43 AM
Unknown Object (File)
Thu, Oct 31, 11:52 AM
Unknown Object (File)
Tue, Oct 22, 1:16 PM
Unknown Object (File)
Tue, Oct 22, 9:13 AM
Unknown Object (File)
Tue, Oct 22, 8:32 AM
Unknown Object (File)
Fri, Oct 18, 2:48 AM
Unknown Object (File)
Thu, Oct 17, 4:46 PM
Unknown Object (File)
Sep 25 2024, 4:12 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.