Fixing unsafe array spreads on Hosting deploys#6713
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
bkendall
requested changes
Jan 24, 2024
| }); | ||
| versions.push(...res.body.versions); | ||
| pageToken = res.body.nextPageToken; | ||
| versions.push(...(res.body?.versions || [])); |
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
Yeah, okay. I just did it. haha
bkendall
approved these changes
Jan 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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