-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix(client): deduplicate messages / lower case join code #1082
Conversation
const currentTimestamp = this._lastSpotState && this._lastSpotState.timestamp; | ||
|
||
if (currentTimestamp && timestamp && currentTimestamp >= timestamp) { | ||
const previousMsgId = this._lastSpotState && this._lastSpotState.msgId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use optional chaining?
@@ -272,7 +275,7 @@ export class RemoteControlServer extends BaseRemoteControlService { | |||
* @returns {Promise} - A Promise resolved when the code has been refreshed. | |||
*/ | |||
refreshJoinCodeWithXmpp() { | |||
const roomLock = generateRandomString(3); | |||
const roomLock = generateRandomString(3).toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the passcode needs to be lowercase, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that the passcode needs to be lowercase, but when you enter it on the remote, even if the ui shows them as upper case it does a toLowerCase() and then sends it to the server.
const trimmedCode = code.trim().toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it!
@@ -82,7 +85,7 @@ export class RemoteControlServer extends BaseRemoteControlService { | |||
// If there's no joinCode service then create a room and let the lock | |||
// be set later. Setting the lock on join will throw an error about | |||
// not being authorized.. | |||
roomName: generateRandomString(3) | |||
roomName: generateRandomString(3).toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about above, when we split a 6 digit code?
No description provided.