Skip to content

Conversation

@shruthilayaj
Copy link
Member

@shruthilayaj shruthilayaj commented Jul 8, 2021

The Transaction Threshold modal was not displaying
the threshold and metric when opened from the
tags and web vitals page. This is because the api
request to retrieve this info was only being fired off
in the txn summary overview page. Updated this by moving
the api calls closer to the settings button in -
TransactionThresholdButton that lives in the txn
summary headers so the api call is made on all the pages.

Display the threshold and metric in all the transaction
summary tabs. Perviously it only showed up in the main
summary page.
});
})
.catch(err => {
this.setState({loadingThreshold: false});
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may intended behaviour, but I will ask anyways lol. Do we still want to set loadingThreshold to false even if both threshold requests fail? This would allow the user to still click the button and they would probably be able to set their threshold if nothing else breaks.

Copy link
Member Author

Choose a reason for hiding this comment

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

The pattern I see in our codebase is to set the loading state to false. And it makes sense that it's no longer loading now that the API request has failed. Although you do bring up a good point about allowing users to interact with the modal if the request fails. I think it should be okay because the API endpoint will only allow them to do things they are allowed to do. I'll think about it some more.

Copy link
Member Author

Choose a reason for hiding this comment

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

I found a case where the get request could fail ahha- if the user has project-transaction-threshold-override flag on but project-transaction-threshold off and they don't have a transaction threshold configured and it tries to fall back to the project threshold. I have this draft PR that would fix it, but it's kinda gross. I'm leaning towards a careful EA rollout of project-transaction-threshold-override and once we are at 100% just fully replacing project-transaction-threshold with project-transaction-threshold-override everywhere. @Zylphrex maybe you have some input on this as you do a second pass?

Copy link
Member

Choose a reason for hiding this comment

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

If I'm understanding this correctly, this shouldn't an issue at all because the set of users with access to project-transaction-threshold-override should always be a subset of the users with access to project-transaction-threshold. And once this is in GA, this constraint will no longer be a concern.

If that's the case, I wouldn't worry too much about this, and just make sure the roll out is correct.

A scenario where this may be problematic is for on-prem where users can turn on whichever flag they want, but this is an edge case that I don't think we should think too hard about as the problem goes away once this is in GA.

'[data-test-id="grid-editable"] [data-test-id="empty-state"]', timeout=2
)
# We have to wait for this again because there are loaders inside of the table
self.page.wait_until_loaded()
Copy link
Member

Choose a reason for hiding this comment

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

Are these additional waits no longer necessary? If not can we remove the corresponding comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

this one was an accidental extra wait, and the ones below are no longer necessary since opening the modal doesn't have any async stuff-- will remove 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I think this one I don't care about since I don't care about the stuff in the table loading. Although maybe I should add it back to prevent flakey tests

Copy link
Contributor

@edwardgou-sentry edwardgou-sentry left a comment

Choose a reason for hiding this comment

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

Nice PR 🔥 ! I couldn't really spot anything wrong, just left 1 question!

});
})
.catch(err => {
this.setState({loadingThreshold: false});
Copy link
Member

Choose a reason for hiding this comment

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

If I'm understanding this correctly, this shouldn't an issue at all because the set of users with access to project-transaction-threshold-override should always be a subset of the users with access to project-transaction-threshold. And once this is in GA, this constraint will no longer be a concern.

If that's the case, I wouldn't worry too much about this, and just make sure the roll out is correct.

A scenario where this may be problematic is for on-prem where users can turn on whichever flag they want, but this is an edge case that I don't think we should think too hard about as the problem goes away once this is in GA.

Comment on lines +117 to +119
if (defined(onChangeThreshold)) {
onChangeThreshold(threshold, metric);
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I personally like to use optional chaining, not a blocker if you leave this alone

Suggested change
if (defined(onChangeThreshold)) {
onChangeThreshold(threshold, metric);
}
onChangeThreshold?.(threshold, metric);

@shruthilayaj shruthilayaj merged commit 07fe05e into master Jul 12, 2021
@shruthilayaj shruthilayaj deleted the fix/transaction-threshold-in-all-tabs branch July 12, 2021 13:15
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants