feat(preprod): Snapshots frontend v1#108278
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f0bf87f to
af96c5b
Compare
dd5a3f9 to
7c60e7c
Compare
af96c5b to
43725f8
Compare
7c60e7c to
48e0ef0
Compare
48e0ef0 to
6c19cb3
Compare
6c19cb3 to
30c0f23
Compare
3089e94 to
2961584
Compare
30c0f23 to
719f641
Compare
Wires up the snapshots GET api that we'll use for both snapshots and snapshot diffs. Frontend implemented in #108278
719f641 to
ebbae43
Compare
| if (!data?.pages) { | ||
| return new Map<string, SnapshotImage[]>(); | ||
| } | ||
| const allImages = data.pages.flatMap(page => page[0].images); |
There was a problem hiding this comment.
Potential null reference when accessing page[0].images in flatMap
The groupedImages memo accesses page[0].images without checking if page[0] is defined. If useInfiniteApiQuery returns a page with an empty or undefined response body (e.g., API returns 200 with no body), this will throw TypeError: Cannot read properties of undefined (reading 'images'). Similar to JAVASCRIPT-2NQW where accessing properties on potentially null API response data caused 39K events.
Suggested fix: Add defensive check to filter out pages with undefined data before accessing images
| const allImages = data.pages.flatMap(page => page[0].images); | |
| const allImages = data.pages.flatMap(page => { | |
| const pageData = page[0]; | |
| return pageData?.images ?? []; | |
| }); |
Identified by Warden [sentry-javascript-bugs] · JSR-BFH
There was a problem hiding this comment.
A bit too defensive, gonna skip as I do wanna catch these while we're testing
Wires up the snapshots GET api that we'll use for both snapshots and snapshot diffs. Frontend implemented in #108278
Wires up the snapshots GET api that we'll use for both snapshots and snapshot diffs. Frontend implemented in #108278
Adds the first version of the snapshots frontend. <img width="1973" height="1688" alt="Screenshot 2026-02-13 at 4 59 32 PM" src="https://github.com/user-attachments/assets/fae1e759-f6b7-4f3c-b451-82b5c76e2919" /> <img width="1973" height="1696" alt="Screenshot 2026-02-13 at 3 20 06 PM" src="https://github.com/user-attachments/assets/23ddf6a9-5b44-4141-b46f-d2bba28eba56" />
Wires up the snapshots GET api that we'll use for both snapshots and snapshot diffs. Frontend implemented in #108278
Adds the first version of the snapshots frontend. <img width="1973" height="1688" alt="Screenshot 2026-02-13 at 4 59 32 PM" src="https://github.com/user-attachments/assets/fae1e759-f6b7-4f3c-b451-82b5c76e2919" /> <img width="1973" height="1696" alt="Screenshot 2026-02-13 at 3 20 06 PM" src="https://github.com/user-attachments/assets/23ddf6a9-5b44-4141-b46f-d2bba28eba56" />

Adds the first version of the snapshots frontend.