Conversation
rebello95
added a commit
that referenced
this pull request
Sep 3, 2019
#381 surfaced an issue where extensions aren't allowed on Swift protocols that are visible to Objective-C. This meant that the Swift `Client` protocol (conformed to by the `Envoy` Swift class) could not provide a default implementation of the non-streaming `send` function, and the function had to be moved into the concrete `Envoy` class so that it could be visible from both Swift and Objective-C. This ended up breaking our Swift tests in `ClientTests.swift` (as mentioned in that PR's description). In order to fix these tests, we need to convert `EnvoyHTTPStream` into a protocol and use an `EnvoyHTTPStreamImpl` concrete type - similarly to how we do with `EnvoyEngine`/`EnvoyEngineImpl`. This PR updates the types accordingly, and fixes the tests. Also renames the tests to `EnvoyTests` rather than `ClientTests` since this is testing the concrete type. Signed-off-by: Michael Rebello <me@michaelrebello.com>
jpsim
pushed a commit
to envoyproxy/envoy
that referenced
this pull request
Nov 28, 2022
envoyproxy/envoy-mobile#381 surfaced an issue where extensions aren't allowed on Swift protocols that are visible to Objective-C. This meant that the Swift `Client` protocol (conformed to by the `Envoy` Swift class) could not provide a default implementation of the non-streaming `send` function, and the function had to be moved into the concrete `Envoy` class so that it could be visible from both Swift and Objective-C. This ended up breaking our Swift tests in `ClientTests.swift` (as mentioned in that PR's description). In order to fix these tests, we need to convert `EnvoyHTTPStream` into a protocol and use an `EnvoyHTTPStreamImpl` concrete type - similarly to how we do with `EnvoyEngine`/`EnvoyEngineImpl`. This PR updates the types accordingly, and fixes the tests. Also renames the tests to `EnvoyTests` rather than `ClientTests` since this is testing the concrete type. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
jpsim
pushed a commit
to envoyproxy/envoy
that referenced
this pull request
Nov 29, 2022
envoyproxy/envoy-mobile#381 surfaced an issue where extensions aren't allowed on Swift protocols that are visible to Objective-C. This meant that the Swift `Client` protocol (conformed to by the `Envoy` Swift class) could not provide a default implementation of the non-streaming `send` function, and the function had to be moved into the concrete `Envoy` class so that it could be visible from both Swift and Objective-C. This ended up breaking our Swift tests in `ClientTests.swift` (as mentioned in that PR's description). In order to fix these tests, we need to convert `EnvoyHTTPStream` into a protocol and use an `EnvoyHTTPStreamImpl` concrete type - similarly to how we do with `EnvoyEngine`/`EnvoyEngineImpl`. This PR updates the types accordingly, and fixes the tests. Also renames the tests to `EnvoyTests` rather than `ClientTests` since this is testing the concrete type. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
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.
Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using
URLSessionand Envoy as a listener.Similar change to #349 which updated the Swift example app.
Notes:
.m, as they don't contain C/++ and thus don't need to be.mmClient.swiftand move the extension function to be implemented directly by theEnvoyclass, since extensions aren't allowed on Swift protocols that are visible to Objective-C. This temporarily breaks theClientTests.swiftfile (not being run on CI), and I will open a PR after this lands to refactor/fix as necessarySigned-off-by: Michael Rebello me@michaelrebello.com