GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make runtime downloadables decoding resilient with LossyArray by BalazsSzamody · Pull Request #5 · XcodesOrg/XcodesKit

Conversation

@BalazsSzamody

@BalazsSzamody BalazsSzamody commented Jul 7, 2026

Copy link
Copy Markdown

Summary

This PR makes DownloadableRuntimesResponse.downloadables resilient to individual malformed entries in Apple’s payload by decoding the array lossily.

Changes

  • Added reusable @LossyArray property wrapper
  • Applied @LossyArray to DownloadableRuntimesResponse.downloadables
  • Added regression test ensuring mixed valid/invalid downloadables decode successfully while retaining valid entries

Why

A single invalid runtime entry from upstream should not fail decoding of the full response.

Validation

  • Ran targeted tests: swift test --filter RuntimeDecodingLossyArrayTests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Balazs Szamody
Add lossy runtime downloadables decoding
cf93fd9
Introduce a reusable LossyArray property wrapper and apply it to DownloadableRuntimesResponse.downloadables so undecodable runtime entries are skipped instead of failing the entire response decode.

Co-authored-by: Copilot <[email protected]>
@BalazsSzamody

BalazsSzamody commented Jul 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

@MattKiazyk I don't have enough context to judge where else could this be extended, but I think it could be a good idea to make the decoding a bit more resilient when depending on external models.

My thinking is that the downloadable runtimes that can be decoded successfully should still be available even if some runtimes fail to decode.
A bit of context on why I arrived to this conclusion:

  • We are using xcodes in our CI pipeline to download earlier iOS runtimes
  • Looking at the latest plist, those runtimes weren't affected by the unhandled added enum case

Feel free to close and ignore this if you don't think it's appropriate.

I also thought about failing the Authentication decoding to nil, but I am not sure if that's the appropriate way as nil authentication might have some semantic meaning as opposed to an unhandled case.

ivanglushko reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot will automatically review once the pull request is marked ready for review

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@BalazsSzamody
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.