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

Correct bug in isStaging method. #1125

Merged
merged 4 commits into from
Jan 9, 2023
Merged

Conversation

tmeyer2115
Copy link
Collaborator

This PR corrects a bug in the isStaging method. If you were referred to a Production site from a Staging link, isStaging would incorrectly report true. This is because the includes check on the href would catch the Staging referrerPageUrl. Simply comparring window.location.hostname instead of window.location.href fixes this. I also did some code cleanup in this method and its test suite.

J=SLAP-2546
TEST=auto

This PR corrects a bug in the `isStaging` method. If you were referred to a Production
site from a Staging link, `isStaging` would incorrectly report `true`. This is because
the `includes` check on the `href` would catch the Staging `referrerPageUrl`. Simply
comparring `window.location.hostname` instead of `window.location.href` fixes this.
I also did some code cleanup in this method and its test suite.

J=SLAP-2546
TEST=auto
@tmeyer2115 tmeyer2115 added the WIP label Jan 9, 2023
@coveralls
Copy link

coveralls commented Jan 9, 2023

Coverage Status

Coverage: 8.817% (+0.07%) from 8.743% when pulling dd57a38 on dev/is-staging-fix into f87864a on hotfix/v1.30.1.

@tmeyer2115 tmeyer2115 removed the WIP label Jan 9, 2023
@tmeyer2115 tmeyer2115 requested a review from oshi97 January 9, 2023 18:55
@tmeyer2115 tmeyer2115 merged commit b3d626f into hotfix/v1.30.1 Jan 9, 2023
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