Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep the original URL when decoding Download/ExternalLocationReference #621

Merged

Conversation

QuietMisdreavus
Copy link
Contributor

Bug/issue #, if applicable: rdar://110536969

Summary

When a DownloadReference or ExternalLocationReference are decoded from JSON, they both modify URL when re-encoded back to JSON. This can cause issues if the URL is different from what either of these types use as their default (/downloads/file and the identifier, respectively). This PR tweaks the Codable logic for both of these types to always use the decoded URL when re-encoding.

Dependencies

None

Testing

This bug manifests when the Render JSON is modified after rendering, and then re-encoded after the fact. As such, testing is restricted to the automated test added in this PR.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • [ n/a ] Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

}
}

static public func ==(lhs: DownloadReference, rhs: DownloadReference) -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Off-topic but I wonder if it's possible to make an @EquatableIgnored macro like: https://developer.apple.com/documentation/observation/observationignored...

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus force-pushed the reference-url-verbatim branch from 7b62f5c to 10edeec Compare June 9, 2023 23:49
@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

Copy link
Contributor

@ethan-kusters ethan-kusters left a comment

Choose a reason for hiding this comment

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

🚀

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

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.

2 participants