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

[NetworkExtension] Updated completionHandler of handleAppMessage #16855

Closed

Conversation

dustin-wojciechowski
Copy link
Contributor

@dustin-wojciechowski dustin-wojciechowski commented Nov 21, 2022

HandleAppMessage as it appears in /src/build/Mac/full/NetworkExtension/NETunnelProvider.g.cs after running generator:

Export ("handleAppMessage:completionHandler:")]
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public unsafe virtual void HandleAppMessage (
NSData messageData, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity1V37))]global::System.Action? completionHandler)

Fixes #16789

@dustin-wojciechowski dustin-wojciechowski changed the title Updated completionHandler of handleAppMessage [src] Updated completionHandler of handleAppMessage Nov 22, 2022
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dustin-wojciechowski dustin-wojciechowski changed the title [src] Updated completionHandler of handleAppMessage [NetworkExtension] Updated completionHandler of handleAppMessage Nov 22, 2022
@stephen-hawley
Copy link
Contributor

👀

@dustin-wojciechowski
Copy link
Contributor Author

dustin-wojciechowski commented Nov 30, 2022

Per discussion with @mandel-macaque, to have a fix in until we make changes to the Generator, I changed argument of Action in HandleAppMessage signature to instead take new NETunnelAppMessageHandler delegate that contains [NullAllowed] NSData.

Generated code:

In SupportDelegates.cs:

namespace NetworkExtension {
	#nullable enable
        ...
	public delegate void NETunnelAppMessageHandler (NSData? data);
}

In NETunnelProvider.g.cs:

[Export ("handleAppMessage:completionHandler:")]
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public unsafe virtual void HandleAppMessage (NSData messageData, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDNETunnelAppMessageHandler))]NETunnelAppMessageHandler? completionHandler)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [PR Build] Build failed 🔥

Build failed for the job 'Build packages'

Pipeline on Agent
Hash: $(GIT_HASH) [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❗ API diff for current PR / commit (Breaking changes)

Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: (empty diff detected)
  • MacCatalyst: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)

❗ API diff vs stable (Breaking changes)

Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (No breaking changes)
  • watchOS: vsdrops gist (No breaking changes)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (No breaking changes)
  • MacCatalyst: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • Microsoft.iOS vs Microsoft.MacCatalyst: vsdrops gist
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: d3ccd629a3519c1fbbf8d58eeb101a8d9a7bfb91 [PR build]

src/networkextension.cs Outdated Show resolved Hide resolved
Comment on lines -1112 to +1117
void HandleAppMessage (NSData messageData, [NullAllowed] Action<NSData> completionHandler);

void HandleAppMessage (NSData messageData, [NullAllowed] NETunnelAppMessageHandler completionHandler);
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change, so we can't do it.

The correct way to do this would be to add a new method overload with the correct signature (the NETunnelAppMessageHandler), and obsolete the old one, but that seems somewhat unnecessary since I believe it's possible to fix the old signature in a backwards compatible way once the generator is fixed.

In other words it might be best to wait until the generator is fixed.

@mandel-macaque mandel-macaque added the do-not-merge Do not merge this pull request label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge Do not merge this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NETunnelProvider.HandleAppMessage() method signature does not match underlying Obj-C Implementation
7 participants