Skip to content

Commit

Permalink
[keyserver/web] Enable announcement subchannel creation
Browse files Browse the repository at this point in the history
Summary: While working on [[https://linear.app/comm/issue/ENG-5182 | ENG-5182]], I noticed that we prevent subchannel creation to be announcement channels. From an initial investigation, it looks like it's been disabled since [[ https://phab.comm.dev/D5211 | D5211 ]]. An error is thrown when attempting to create a new subchannel with the announcement setting because it fails the [[ https://github.com/CommE2E/comm/blob/ce4e185558c1a5af773a4291a44b0c6c19c88fcf/keyserver/src/responders/thread-responders.js#L169-L186 | input validation ]].

Test Plan: Ran `yarn workspace lib test` (to make sure `thread-responders.test.js` still worked, and more importantly manually tested creating both an open announcement subchannel and a secret announcement subchannel. The permissions like I mentioned are kind of weird though since non-members of the new secret subchannel can discover it in the navigation drawer, so I'll make it part of my overall permissions fixes for ENG-5182.

Reviewers: atul, ginsu, michal, ashoat

Reviewed By: ashoat

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9489
  • Loading branch information
RohanK6 committed Oct 17, 2023
1 parent d50653f commit f04b4ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions keyserver/src/responders/thread-responders.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ const newThreadRequestInputValidator: TUnion<ServerNewThreadRequest> = t.union([
threadTypes.LOCAL,
threadTypes.COMMUNITY_ROOT,
threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT,
threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD,
threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD,
]),
...threadRequestValidationShape,
}),
Expand Down
7 changes: 1 addition & 6 deletions web/modals/threads/create/compose-subchannel-modal.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ function ComposeSubchannelModal(props: Props): React.Node {

return result;
} catch (e) {
await setErrorMessage(
e.message === 'invalid_parameters' && announcement
? 'announcement channels currently not available'
: 'unknown error',
);

await setErrorMessage('unknown error');
return null;
}
}, [
Expand Down

0 comments on commit f04b4ec

Please sign in to comment.