Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions static/gsApp/stores/subscriptionStore.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('SubscriptionStore', () => {

it('should load data', async () => {
MockApiClient.addMockResponse({
url: `/subscriptions/${organization.slug}/`,
url: `/customers/${organization.slug}/`,
body: subscription,
});

Expand All @@ -35,7 +35,7 @@ describe('SubscriptionStore', () => {

it('should mark trial started and clear trial', async () => {
MockApiClient.addMockResponse({
url: `/subscriptions/${organization.slug}/`,
url: `/customers/${organization.slug}/`,
body: subscription,
});

Expand Down
2 changes: 1 addition & 1 deletion static/gsApp/stores/subscriptionStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const subscriptionStoreConfig: SubscriptionStoreDefintion = {
}
this.loadingData[orgSlug] = true;

const data = await this.api.requestPromise(`/subscriptions/${orgSlug}/`);
const data = await this.api.requestPromise(`/customers/${orgSlug}/`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The migration from the deprecated /subscriptions/ endpoint to /customers/ is incomplete. usePerformanceSubscriptionDetails.tsx still uses the old endpoint, which will cause API failures on performance and explore pages.
Severity: HIGH

Suggested Fix

Update the API endpoint in static/app/views/performance/newTraceDetails/traceTypeWarnings/usePerformanceSubscriptionDetails.tsx to use /customers/${organization.slug}/ instead of /subscriptions/${organization.slug}/. Also, search for and update any remaining test mocks that still use the deprecated endpoint.

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/gsApp/stores/subscriptionStore.tsx#L110

Potential issue: The pull request updates an API endpoint from the deprecated
`/subscriptions/${orgSlug}/` to `/customers/${orgSlug}/`. However, this migration is
incomplete. The file
`static/app/views/performance/newTraceDetails/traceTypeWarnings/usePerformanceSubscriptionDetails.tsx`
was not updated and still references the old endpoint. This hook is actively used in
performance trace details and explore pages. As a result, users accessing these features
will encounter API failures, as the frontend will attempt to fetch data from a
deprecated or non-existent endpoint, leading to broken functionality.

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

if (markStartedTrial) {
data.isTrialStarted = true;
}
Expand Down
Loading