Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow external users from private room #172

Merged
merged 16 commits into from
Sep 28, 2022

Conversation

mcalinghee
Copy link
Contributor

@mcalinghee mcalinghee commented Sep 14, 2022

Allow external users from private room

Screenshot 2022-09-27 at 16 29 04

Create a private room opened to external users(bug fix)

This PR allow external users from a private room but also create a private room opened to external users(fix a small bug)

Before:

  1. Create a room opened to externals

Screenshot 2022-09-27 at 16 38 53

2. Settings in v2 : we expect that the room is opened to external => this is not the case here

Screenshot 2022-09-27 at 16 41 33

3. Settings of the room in v4 : we expect that the room is opened to external => this is not the case here

Screenshot 2022-09-27 at 16 44 58

After:

  1. Create a room opened to externals

image

2. Settings in v2 : we expect that the room is opened to external => OK

Screenshot 2022-09-27 at 16 36 47

3. Settings of the room in v4 : we expect that the room is opened to external => OK

image

@mcalinghee mcalinghee changed the title basic implementation to allow external users Allow external users from private room Sep 14, 2022
@mcalinghee mcalinghee linked an issue Sep 14, 2022 that may be closed by this pull request
11 tasks
@mcalinghee mcalinghee changed the base branch from 111-remove-public-private-switch to develop_tchap September 15, 2022 08:55
@mcalinghee mcalinghee marked this pull request as ready for review September 15, 2022 09:01
@mcalinghee mcalinghee added the web label Sep 16, 2022
@mcalinghee mcalinghee self-assigned this Sep 16, 2022
@odelcroi
Copy link
Member

I guess that we need heavy testing on this PR to approve it or would end to end testing be easy to implement?

@mcalinghee
Copy link
Contributor Author

mcalinghee commented Sep 27, 2022

I guess that we need heavy testing on this PR to approve it or would end to end testing be easy to implement?

[EDIT] As discussed ,we will look at this later on , we need to check unit test

content => cli.sendStateEvent(room.roomId, RoomAccessRulesEventId, content, ""),
onError,
);
const { rule: accessRule = undefined } = contentAccessRule || {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi le default undefined, sachant qu'on a deja || {} ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cela permet d'assigner accessRule à undefined si contentAccessRule est lui aussi `undefined

Si on enleve {}, on peut avoir l'erreur suivante : Error: Cannot read properties of undefined (reading 'rule')

@@ -105,10 +114,42 @@ const JoinRuleSettings = ({ room, promptUpgrade, aliasWarning, onError, beforeCh
const definitions: IDefinition<JoinRule>[] = [];

if (joinRule === JoinRule.Invite) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this selecting private rooms only ? So far we were are copying android's implementation for determining what type of room it is :
https://github.com/tchapgouv/tchap-android/blob/develop/vector/src/main/java/fr/gouv/tchap/core/utils/RoomUtils.kt#L31
(selection on isEncrypted and accessRules)

It would be nice to have a utils function (in TchapUtils for example) that checks what type of room it is.
v2 had a isRoomForum function for example, we could do something similar

src/i18n/strings/en_EN.json Outdated Show resolved Hide resolved
src/i18n/strings/en_EN.json Outdated Show resolved Hide resolved
src/@types/tchap.ts Outdated Show resolved Hide resolved
src/components/views/settings/TchapJoinRuleSettings.tsx Outdated Show resolved Hide resolved
src/lib/createTchapRoom.ts Show resolved Hide resolved
@estellecomment
Copy link
Contributor

estellecomment commented Sep 27, 2022

I cannot invite externs. I get a silent fail, nothing happens.

Running locally, with prod backend, after a clearing of node_modules and rebuild :
Error in console : t is undefined. Happens here : https://github.com/matrix-org/matrix-react-sdk/blob/68b3fd78c2759b6b1c6de6f86c93a3e021db36ec/src/components/views/dialogs/InviteDialog.tsx#L929-L930

Reproduce : create a room (with or without externs). Invite an extern by email.
Same thing happens whether the extern account exists already or not.

Edit : I will try testing on the review app tomorrow, in case it is a local problem. (will move review app to prod backend for testing)

@estellecomment
Copy link
Contributor

Missing translation in french :
image

@mcalinghee
Copy link
Contributor Author

Missing translation in french : image

Translation was added

@estellecomment
Copy link
Contributor

(closing and reopening PR to trigger the review app, it had been deleted from lack of activity)

@estellecomment
Copy link
Contributor

When testing with my account, on prod backend, it works when you paste the email, rather than type it.
Works with externs who already have an account, or not.

There are issues, unrelated to this PR, with :

  • when you type the email and press enter or space, the invite dialog crashes.
  • inviting fails sometimes because of a 403 on GET https://matrix.agent.dinum.tchap.gouv.fr/_matrix/identity/v2/terms. This is the client trying to get the user to approve the terms and conditions of the identity server. This should not be happening, terms in Tchap do not need to be approved. Seen on a user created in v2 but only used in v4.

Will file separate issues.

So, testing passes !

@estellecomment
Copy link
Contributor

Other issue :

  • in a room without externs, the toggle appears disabled, when actually it does work.
    image

  • when the toggle is disabled, there is no explanation about why.

I'll look into them now.

@estellecomment
Copy link
Contributor

About the disabled toggle : it's actually fine.
It's just that the color for a toggle that's enabled and off is grey (which I associate with disabled). It's consistent with the rest of the app.

@estellecomment
Copy link
Contributor

For the extra info, it's complicated to add because the toggle is part of the "Public" radiobutton description.
We should move it out of the "Public" radiobutton.
Not doing in this PR.

@estellecomment estellecomment merged commit f7b475d into develop_tchap Sep 28, 2022
@mcalinghee mcalinghee linked an issue Oct 24, 2022 that may be closed by this pull request
@odelcroi odelcroi deleted the 111-allow-external-user-in-private-room branch March 31, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Settings : Authorize access to external from a private room
3 participants