Skip to content

Conversation

@joehan
Copy link
Contributor

@joehan joehan commented Jan 24, 2024

Description

Fixing some unsafe array spreads in the Hosting API client. This was inspired by #6172 - I'm not sure why the backend is not returning versions there (and we might wanna look into that more), but either way we should not blow up there.
Fixes #6712

@joehan joehan requested a review from bkendall January 24, 2024 18:09
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.15%. Comparing base (cafb50d) to head (d4980c8).
⚠️ Report is 1485 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6713   +/-   ##
=======================================
  Coverage   54.15%   54.15%           
=======================================
  Files         347      347           
  Lines       24134    24130    -4     
  Branches     4981     4982    +1     
=======================================
- Hits        13070    13068    -2     
  Misses       9863     9863           
+ Partials     1201     1199    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

});
versions.push(...res.body.versions);
pageToken = res.body.nextPageToken;
versions.push(...(res.body?.versions || []));
Copy link
Contributor

Choose a reason for hiding this comment

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

Body isn't the problem, it's the lack of versions.

I'd suggest changing ListVersionsResponse to have versions?: Version[], then do versions.push(...(res.body.versions ?? [])); here.

Similar to the sites response, if you really want to do that too.

Please add tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, okay. I just did it. haha

@bkendall bkendall enabled auto-merge (squash) January 24, 2024 19:41
@bkendall bkendall merged commit 4e6529b into master Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't deploy project due to ...res.body.versions undefined

3 participants