Skip to content

Conversation

nikkikapadia
Copy link
Member

add the page params to the transaction widget warning urls on the frontend so they can see the same thing if they haven't submitted their dashboard filters. NOTE: i noticed that now the entire dashboard reloads when changing dashboard filters because the urls have to be re-rendered. This kinda sucks but it will be temporary

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 8, 2025
@nikkikapadia nikkikapadia marked this pull request as ready for review October 8, 2025 19:14
@nikkikapadia nikkikapadia requested a review from a team as a code owner October 8, 2025 19:14
});

return null;
return params.length > 0 ? `${baseUrl}&${params.join('&')}` : baseUrl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: URL Construction Fails Without Existing Query

The createExploreUrl function constructs invalid URLs because it always appends query parameters with &. When the baseUrl doesn't already have a query string, this results in an improperly formatted URL.

Fix in Cursor Fix in Web

Comment on lines +99 to 109
params.push('utc=true');
}

selection.projects.forEach(project => {
params.push(`project=${project}`);
});

selection.environments.forEach(environment => {
params.push(`environment=${environment}`);
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: URL parameters are not encoded, leading to broken links for environment names with special characters.
  • Description: The createExploreUrl function constructs URL parameters without encoding them. Since environment names can contain special characters like '&', '=', or spaces, concatenating them directly into the URL string will result in malformed and broken URLs. This impacts the functionality of the 'Explore' links for users with such environment names.

  • Suggested fix: Use encodeURIComponent on the values of the parameters before adding them to the URL string. For example, change params.push(environment=${environment}); to params.push(environment=${encodeURIComponent(environment)});.
    severity: 3.0, confidence: 5.0

Did we get this right? 👍 / 👎 to inform future reviews.

Comment on lines +89 to +108
if (selection.datetime?.start) {
params.push(`start=${getUtcDateString(selection.datetime.start)}`);
}
if (selection.datetime?.end) {
params.push(`end=${getUtcDateString(selection.datetime.end)}`);
}
if (selection.datetime?.period) {
params.push(`statsPeriod=${selection.datetime.period}`);
}
if (selection.datetime?.utc) {
params.push('utc=true');
}

selection.projects.forEach(project => {
params.push(`project=${project}`);
});

selection.environments.forEach(environment => {
params.push(`environment=${environment}`);
});
Copy link
Member

@shruthilayaj shruthilayaj Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels a little janky to me, could we instead parse this URL, something like

const parsedURL = safeURL(baseUrl);
const queryParams = qs.parse(parsedURL?.search ?? '');

// append all the page filters to queryParams - perhaps use an existing util like pageFiltersToQueryParams
return  getExploreUrl(queryParams)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants