-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(releases): Add mobile tab to releases #104376
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
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| numberOfMobileBuilds === 0 ? ( | ||
| <BadgeWrapper> | ||
| <FeatureBadge type="new" /> | ||
| <FeatureBadge type="beta" /> |
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.
Unifying on "Beta" per Max and I's discussion
| selection={selection} | ||
| /> | ||
| <ReleasesPageFilterBar condensed> | ||
| <Layout.Header noActionWrap> |
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.
| )} | ||
|
|
||
| {selectedTab === 'releases' && ( | ||
| <Fragment> |
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.
All content here is the same, just gated behind the selectedTab being 'releases'
| const ReleasesPageFilterBar = styled(PageFilterBar)` | ||
| margin-bottom: ${space(2)}; | ||
| const ReleasesPageFilterBar = styled(PageFilterBar)<{shouldShowMobileBuildsTab: boolean}>` | ||
| ${p => !p.shouldShowMobileBuildsTab && `margin-bottom: ${p.theme.space.xl};`} |
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.
| ([...mobile, ...desktop] as string[]).includes(releaseProjectPlatform); | ||
| export const isMobileRelease = ( | ||
| releaseProjectPlatform: PlatformKey, | ||
| includeDesktop = true |
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.
that's a funny prop
isMobile .... or sometimes desktop. lol
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 agree but I admittedly don't have context here. Appears this change is just styling but will follow up and remove this weird includeDesktop behavior if I get the greenlight to from @mtopo27
ryan953
left a comment
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.
works for me. some nits if that's your thing.
when you're ready!
| if (!shouldShowMobileBuildsTab) { | ||
| return 'releases'; | ||
| } | ||
| return (decodeScalar(location.query.tab) as ReleaseTab | undefined) || 'releases'; |
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.
Bug: The tab URL query parameter is not validated at runtime. An invalid value causes the component to render a blank page instead of defaulting to the 'releases' view.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The selectedTab variable is derived from the tab URL query parameter using decodeScalar. This value is then type-cast to ReleaseTab | undefined without any runtime validation. If a user provides an invalid tab value in the URL, such as ?tab=invalid, selectedTab will hold this invalid string. Consequently, the conditional rendering for both the 'releases' and 'mobile-builds' tabs will fail, resulting in the page rendering an empty content area instead of defaulting to a valid view.
💡 Suggested Fix
Add runtime validation to ensure the value from decodeScalar(location.query.tab) is one of the expected values ('releases' or 'mobile-builds'). If it's not, default to 'releases'. For example: const tabValue = decodeScalar(location.query.tab); return (tabValue === 'mobile-builds' || tabValue === 'releases') ? tabValue : 'releases';.
🤖 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: static/app/views/releases/list/index.tsx#L230
Potential issue: The `selectedTab` variable is derived from the `tab` URL query
parameter using `decodeScalar`. This value is then type-cast to `ReleaseTab | undefined`
without any runtime validation. If a user provides an invalid tab value in the URL, such
as `?tab=invalid`, `selectedTab` will hold this invalid string. Consequently, the
conditional rendering for both the 'releases' and 'mobile-builds' tabs will fail,
resulting in the page rendering an empty content area instead of defaulting to a valid
view.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6962494



context: https://www.notion.so/sentry/Integrating-with-releases-short-term-fix-2b08b10e4b5d80cbb28ccbdefe46f7f8#2b58b10e4b5d80acb810f8af7c651bac
When mobile project selected:


When non-mobile project is selected (also tested to confirm default releases page is handled when switching from mobile back to non-mobile):
