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

Copyable link to enter specific rooms #73

Merged
merged 6 commits into from
Aug 4, 2020
Merged

Conversation

user512
Copy link
Contributor

@user512 user512 commented Aug 3, 2020

Part of #39 & #59:
This pull request intended to allow copyable link to enter specific rooms by initialize Jitsi connection when user go to /workspaces/workspace-slug/rooms/room-slug.
Since branded-domain link looks nicer, all rooms/ workspaces links will use custom domain and use conventional RESTful path as a fallback.

Since we migrated to server side path, previous JS solution is cleaned up.

Part of #23, remove Fellow Jitser display name.

TODO:

Screen Shot 2020-08-03 at 2 57 55 PM

Screen Shot 2020-08-03 at 3 52 10 PM

@user512 user512 force-pushed the can-copy-room-url branch from 62fb606 to 1ae525b Compare August 3, 2020 18:06
Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

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

Looking quite nice! If you want me to take a stab at building on top of this I can try it this evening.

@@ -21,7 +21,6 @@ export default class VideoRoom {
}

exitRoom() {
this.jitsi.dispose();
Copy link
Member

Choose a reason for hiding this comment

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

Don't we still want to dispose of Jitsi when we exit a room?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, going to clean up unnecessary js on next commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe what dispose() does is to remove all listeners and remove the iframe.
https://github.com/jitsi/jitsi-meet/blob/342a00a6af323d98eef33fc60f4e2a515c8e254d/modules/API/external/external_api.js#L521-L527
Since we are reloading the page anyway, so I decided to remove all logic using dispose().

Copy link
Member

Choose a reason for hiding this comment

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

I am slightly worried it leaves the server thinking the connection is not closed; but we can validate that by seeing that when user A leaves by clicking a button, user B sees them leave immediately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good concern, I have confirmed once user A leaves, user B sees them leave.
But I wasn't sure how the server was able to detect that.

private def current_room
@current_room ||= current_workspace.rooms.friendly.accessable_by(current_person).find(params[:id])
end
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what current_room means in this case; but it looks kind of like we're starting to define loader methods; which makes me want to reach for a tool like decent_exposure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to expose the room show in rooms/show.html.erb.
Could be I haven't understand the benefit of decent_exposure but don't feel like pull in a library to expose a room just yet.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, the value in decent_exposure is it creates a standard mechanism for exposing the data that a controller wants to expose in a way that is consistent across all controllers. I think it’s something to look into as we start wiring in pundit; or if we start defining helper methods to expose data to the UI instead of a single instance variable.

@@ -5,6 +5,6 @@
resources :workspaces
constraints BrandedDomain.new(Workspace) do
root 'workspaces#show'
get "/:id", to: 'rooms#show'
get "/:id", to: 'rooms#show', as: :room
Copy link
Member

Choose a reason for hiding this comment

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

I think that we want room names on branded domains to purely be an entrance point, so we don't want to overload the room_path and instead we want to continue to use workspace_room_path(workspace.slug, room.slug) when creating links.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just realized we want to keep the host/workspaces/:workspaces_slug/rooms/:room_slug, now I understand this, will make change.

@user512 user512 marked this pull request as ready for review August 3, 2020 22:32
@user512 user512 requested a review from zspencer August 4, 2020 01:54
Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

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

I think this is good enough to merge, but I’m worried that we’re defining custom route handlers instead of leaning into the built in Rails routing. This kind of divergence is how Rails projects start accumulating cruft that makes working with them surprising.

else
workspace_path(workspace)
end
end
Copy link
Member

@zspencer zspencer Aug 4, 2020

Choose a reason for hiding this comment

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

These custom paths methods indicate to me that we’re “going off the Rails.” I’d rather we rely on workspace_path and workspace_room_path and don’t create custom path methods.

We can look into overriding those methods in a Rails-y way; but creating methods that feel like routes but aren’t in the actual routes system makes me nervous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One thing I don't like about this branded_domain route is it's making smoke test locally more difficult, I am more concern on how we write e2e test on this.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, that's why I'm trying to make sure it's something that only exists as an entrance point into the system; and not as something that the system tries to maintain consistency on. Essentially it's something you put on the business card; but it's not something we project back into the world.

@user512 user512 merged commit 036f20e into development Aug 4, 2020
@user512 user512 deleted the can-copy-room-url branch August 4, 2020 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants