ref(usageStatsOrg): Convert component from class to function + useApiQuery#90884
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #90884 +/- ##
==========================================
+ Coverage 87.63% 87.82% +0.19%
==========================================
Files 10324 10293 -31
Lines 585809 581955 -3854
Branches 22628 22417 -211
==========================================
- Hits 513396 511130 -2266
+ Misses 71985 70411 -1574
+ Partials 428 414 -14 |
e267649 to
ea1d06f
Compare
| /** | ||
| * We allow 403s since we don't know if spike protection is enabled for the project or not | ||
| * If not, don't raise an error since we can still show usage data. | ||
| * We allow 404s in case they don't have access to new spike protection just yet | ||
| */ | ||
| const ALLOWED_STATUSES = new Set([403, 404]); |
There was a problem hiding this comment.
Now we are using useApiQuery and will not block the whole page if an endpoint fails. I believe this no longer makes sense
…' of github.com:getsentry/sentry into priscila/ref/usage-stats-org/convert-from-class-to-func
…ion.tsx Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
…' of github.com:getsentry/sentry into priscila/ref/usage-stats-org/convert-from-class-to-func
|
|
||
| export interface UsageStatsOrganizationProps { | ||
| dataCategory: DataCategory; | ||
| dataCategoryApiName: DataCategoryInfo['apiName']; |
There was a problem hiding this comment.
i know you didn't touch this in your pr but i think this type is wrong LOL, i can tackle this if you don't here though
There was a problem hiding this comment.
why do you think this type is wrong?
| const orgStatsQuery = | ||
| endpointQuery ?? | ||
| getEndpointQuery({ | ||
| dataCategoryApiName, | ||
| dataDatetime, | ||
| organization, | ||
| projectIds, | ||
| endpointQueryDatetime: getEndpointQueryDatetime(dataDatetime), | ||
| }); |
There was a problem hiding this comment.
this probably needs to be memoized if its being used as a dependency later since it will create a new object every render
…Query (#90884) Contributes to the initiative https://www.notion.so/sentry/Frontend-TSC-Project-Convert-DeprecatedAsyncComponent-to-FC-useApiQuery-1ac8b10e4b5d8050b8f0d4a62a08526b?cookie_sync_completed=true closes TET-376
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Contributes to the initiative https://www.notion.so/sentry/Frontend-TSC-Project-Convert-DeprecatedAsyncComponent-to-FC-useApiQuery-1ac8b10e4b5d8050b8f0d4a62a08526b?cookie_sync_completed=true
closes TET-376
Note
Compared several data points against production, and everything looks good, but I appreciate more checks