Merged
Conversation
| }} | ||
| textZoom={125} | ||
| onShouldStartLoadWithRequest={(event) => { | ||
| if (!/^[data:text, about:blank]/.test(event.url)) { |
There was a problem hiding this comment.
Bug: The regex /^[data:text, about:blank]/ incorrectly uses a character class, causing many external links in notifications to be mishandled and opened within the app's WebView.
Severity: CRITICAL
Suggested Fix
Update the regular expression to correctly match the literal strings 'data:' or 'about:blank' at the beginning of the URL. The corrected pattern should be /^(data:|about:blank)/, which uses a non-capturing group and an OR condition.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/screens/NotificationDetail.tsx#L61
Potential issue: The regular expression used to test URLs is incorrect. The pattern
`/^[data:text, about:blank]/` uses a character class `[]`, which matches any single
character within the brackets at the start of a string. This causes legitimate external
URLs that start with common letters like 'd', 'a', 't', or 'c' (e.g., `docs.gitlab.com`)
to be incorrectly identified as internal URLs. As a result, these external links are
loaded within the app's WebView instead of being opened in the user's external system
browser, breaking the intended navigation flow for users viewing notifications.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.