Fixed pattern matching for external and internal page links #2133
Summary
Pattern matching for the /p/ pages is broken on production. To replicate, go and click the iOS link in the footer.
Our system is seeing the URL itunes.apple.com/us/app/minds-com/id961771928%3Fmt Seeing that it contains '/p' and thinking that it is an internal page
This happened because the system was looking simply for indexOf('p/')
For this fix I have upgraded that check to a regex check, in a commonly held service.
Steps to test
Ignore the first iPhone link - that is invalid data that for now is trapped in the sandbox. (If there is now only 1 link for iPhone, include it in the test, we may have found the missing schema and fixed).
- Not logged in, check the links on the bottom footer, ensure they're all working
- Log in, check the links on the newsfeed footer
- Check the links on the actual /p/ pages, like https://www.minds.com/p/terms-of-service/
- Check the pro footer hasn't been effected https://www.minds.com/pro
Estimated Regression Scope
The components touched by this are: Footer, register homepage and newsfeed.
I think the worst-case scenario would be a failure in the Regex logic causing another pattern matching issue.
added scoped labels
- Developer
added 1 commit
- a06f22a5 - Turned regex.test into path.match(regex) because of weird error
changed the description
added scoped label and automatically removed label
- Resolved by Ben Hayward
approved this merge request
- Developer
Looks good! Internal links seem to be working OK on the sandbox site.
added scoped label and automatically removed label
added scoped label and automatically removed label
resolved all threads
assigned to @brianhatchet and @xander-miller
approved this merge request
added scoped label and automatically removed label
- Developer
Re-tested, working OK on review site.
approved this merge request
added 15 commits
-
267e8228...7b93f3f1 - 14 commits from branch
master
- 0eb70a77 - Merge branch 'master' into 'fix/external-pages-regex-2133'
-
267e8228...7b93f3f1 - 14 commits from branch
- Developer
Note, merge conflicts lost this card its approvals from mark and Emi.
Change was just that both were trying to add an import. Used 'both' merge strat.
approved this merge request
added scoped label and automatically removed label
- Developer
Merge conflicts again
added 10 commits
-
0eb70a77...1c8ee565 - 8 commits from branch
master
- 9260794e - Merge branch 'master' of gitlab.com:minds/front into fix/external-pages-regex-2133
- 4bfb935d - Merge branch 'fix/external-pages-regex-2133' of gitlab.com:minds/front into...
-
0eb70a77...1c8ee565 - 8 commits from branch