Skip to content

Ensure dimension changes invalidate view#376

Closed
tomhicks wants to merge 1 commit intotwilio:masterfrom
tomhicks:patch-1
Closed

Ensure dimension changes invalidate view#376
tomhicks wants to merge 1 commit intotwilio:masterfrom
tomhicks:patch-1

Conversation

@tomhicks
Copy link
Copy Markdown
Contributor

@tomhicks tomhicks commented Dec 2, 2020

The track.dimensions object remains the same throughout the lifespan of the track, but its values are updated. This means that the setter always receives the same object and therefore doesn't result in the state actually changing.

By copying the dimension values into a new object, we ensure that consumers of this hook are always kept up to date with the new dimensions.

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Pull Request Details

JIRA link(s):

Description

A description of what this PR does.

Burndown

Before review

  • Updated CHANGELOG.md if necessary
  • Added unit tests if necessary
  • Updated affected documentation
  • Verified locally with npm test
  • Manually sanity tested running locally
  • Included screenshot as PR comment (if needed)
  • Ready for review

Before merge

  • Got one or more +1s
  • Re-tested if necessary

The track.dimensions object remains the same throughout the lifespan of the track, but its values are updated. This means that the setter always receives the same object and therefore doesn't result in the state actually changing.

By copying the dimension values into a new object, we ensure that consumers of this hook are always kept up to date with the new dimensions.
@timmydoza
Copy link
Copy Markdown
Contributor

Thanks @tomhicks! What a great catch!

For security reasons, our CI pipeline won't run on pull requests from outside contributors. So I've pulled your changes down, added a test case, and pushed up a new branch that I created a PR for. This way our CI test will run, and you will still be listed as a contributor.

PR here: #387

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