Skip to content

Commit bb77ee1

Browse files
committed
Error page graph: for a time bucket don't fill zeros for a version with no errors
This caused performance issues with large numbers of versions, and bad UX when hovering the graph (showing irrelevant versions)
1 parent 7d82041 commit bb77ee1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/webapp/app/presenters/v3/ErrorGroupPresenter.server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,15 @@ export class ErrorGroupPresenter extends BasePresenter {
242242

243243
const sortedVersions = sortVersionsDescending([...versionSet]);
244244

245+
// Build the data for the graph
246+
// For each time bucket, if a value exists for a version set the value (don't add zeros)
245247
const data = buckets.map((epoch) => {
246248
const point: Record<string, number | Date> = { date: new Date(epoch * 1000) };
247249
for (const version of sortedVersions) {
248-
point[version] = byBucketVersion.get(`${epoch}:${version}`) ?? 0;
250+
const versionValue = byBucketVersion.get(`${epoch}:${version}`);
251+
if (versionValue) {
252+
point[version] = versionValue;
253+
}
249254
}
250255
return point;
251256
});

0 commit comments

Comments
 (0)