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

Explicit video url #128

Closed
wants to merge 37 commits into from
Closed

Explicit video url #128

wants to merge 37 commits into from

Conversation

osdiab
Copy link
Member

@osdiab osdiab commented Oct 13, 2018

pass video urls explicitly to the api, rather than inferring them.

Cannot be deployed until associated migration is written/ran, and mobile app is using new client.

@osdiab osdiab requested a review from rahulgi October 13, 2018 05:27
@osdiab osdiab self-assigned this Oct 13, 2018

if (!videoToken) {
throw new MissingParamsError(["videoToken"]);
if (!videoReference) {
Copy link
Member

Choose a reason for hiding this comment

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

think it might be worth having some validation of videoReferences.


return publicVideoRef;
}
// async function movePrivateVideoToPublicVideo(
Copy link
Member

Choose a reason for hiding this comment

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

also we'll need this stuff until all clients have updated o.o + create videoReferences server side for older clients :/

videoToken: string,
isJointVideo: boolean
) {
export function sendInvite(args: {
Copy link
Member

Choose a reason for hiding this comment

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

What's the args: { } change for? Don't see anything different in the call-sites

Copy link
Member Author

Choose a reason for hiding this comment

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

Just would rather be using named arguments than positional ones, less likely to mess them up, less brittle to stuff like mistaken orderings, better automatic code suggestions

Copy link
Member Author

Choose a reason for hiding this comment

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

but i can save that for a separate pr

@osdiab osdiab force-pushed the osdiab/feature/explicit-video-url branch from 74a4dc8 to d670ec7 Compare October 31, 2018 10:54
@osdiab osdiab force-pushed the osdiab/feature/explicit-video-url branch from d670ec7 to 49e17e7 Compare October 31, 2018 11:04

import { callApi } from "../callApi";

/**
* API call for a non-member to join Raha and create a new member.
* @param fullName Full name of new member
* @param username New username for the new member. Must be unique
* @param videoToken Video token of the invite, of the new member either identifying themselves or
* being invited by the existing member.
* @param videoReference Video of the new member either identifying themselves.
Copy link
Member

Choose a reason for hiding this comment

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

"either identifying themselves or being invited by the existing member""

@@ -21,7 +21,7 @@ export const listMembers = (membersCollection: CollectionReference) =>
id: member.id,
created_at: member.get("created_at"),
full_name: member.get("full_name"),
identity_video_url: member.get("identity_video_url"),
identityVideoReference: member.get("identityVideoReference"),
Copy link
Member

Choose a reason for hiding this comment

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

why switch to camel-case? should we be consistent?

Copy link
Member Author

Choose a reason for hiding this comment

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

this PR is closed since it's not backwards compatible, but i think it's lame we even have any inconsistency about using snake_case here at all so I wanted to incrementally move new stuff to camel case. But given that we'll have to support old versions indefinitely, i'll just make it be snake_case and embrace the pointless inconsistency

Copy link
Member

Choose a reason for hiding this comment

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

I thought in general we did underlines for field names

Copy link
Member Author

@osdiab osdiab Nov 2, 2018

Choose a reason for hiding this comment

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

the only place we ever do it is operation field names, probably bc @rahulgi defined the schema when he was more in python mode than javascript, so every time we go from operations to code we have to keep renaming things from snake case to camel case; it's pointless but we've committed

Copy link
Member

Choose a reason for hiding this comment

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

can we just migrate things? i'm ok with doing camelcase moving forward

@@ -46,15 +46,15 @@ export const sendInvite = (
loggedInMember
);

const { inviteEmail, videoToken, isJointVideo } = call.body;
const { inviteEmail, videoReference, isJointVideo } = call.body;

if (!loggedInMember.exists) {
throw new InviterMustBeInvitedError();
}

const requiredParams = {
Copy link
Member

Choose a reason for hiding this comment

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

Would this break if an older client tried to invite someone?

Copy link
Member Author

Choose a reason for hiding this comment

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

this PR doesn't support backwards compatibility and is now closed

errors.push({
...errorDetailBase,
message: `Field 'kind' expected to be '${
MediaReferenceKind.VIDEO
Copy link
Member

Choose a reason for hiding this comment

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

expectedKind?

@osdiab
Copy link
Member Author

osdiab commented Nov 2, 2018

There's no need to PR this anymore because we can't rely on codepush to invalidate old clients, so closing.

@osdiab osdiab closed this Nov 2, 2018
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.

3 participants