-
Notifications
You must be signed in to change notification settings - Fork 32
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
add message origin checking for SMART Web Messaging #126
Conversation
@jmandel, @dennispatterson - PTAL |
// TODO: convert this to a stack so newer messages are on top. | ||
this.setState({ messages: [...this.state.messages, message] }); |
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.
Do you want to swap the order of array elements here, so the splice comes in later? Otherwise, maybe remove the TODO or convert to a github issue.
// TODO: convert this to a stack so newer messages are on top. | |
this.setState({ messages: [...this.state.messages, message] }); | |
this.setState({ messages: [message, ...this.state.messages] }); |
... but this probably needs additional tests, too. So, your call on how to incorporate.
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've created a separate issue here: #129
Referencing the issue created to change the message ordering.
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.
Looks good to me! @dennispatterson do you want to take a look too, or are you happy to merge?
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.
Apologies for the delay. Looks good, @barabo!
I've added a filter to enforce origin checking, causing the sandbox to ignore messages that don't match the expected origin. I've also updated the unit test to pass.