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

[CarPlay] [Xcode 12] Update through beta 6 #9479

Merged
merged 12 commits into from
Aug 28, 2020

Conversation

whitneyschmidt
Copy link
Contributor

@whitneyschmidt whitneyschmidt commented Aug 24, 2020

@whitneyschmidt whitneyschmidt added the iOS Issues affecting Xamarin.iOS label Aug 24, 2020
@whitneyschmidt whitneyschmidt added this to the xcode12 milestone Aug 24, 2020
public partial class CPMessageListItem {

public CPMessageListItem (string identifier, string text, CPMessageListItemLeadingConfiguration leadingConfiguration,

Copy link
Member

Choose a reason for hiding this comment

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

Weird new line here, right?

TwoColumn,
}

[Native]
Copy link
Member

Choose a reason for hiding this comment

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

Missing availability attrs.

Cloud,
}

[Native]
Copy link
Member

Choose a reason for hiding this comment

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

Same

Trailing,
}

[Native]
Copy link
Member

Choose a reason for hiding this comment

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

Same

Star,
}

[Native]
Copy link
Member

Choose a reason for hiding this comment

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

Same

src/carplay.cs Outdated
[Export ("searchTemplate:updatedSearchText:completionHandler:")]
void UpdatedSearchText (CPSearchTemplate searchTemplate, string searchText, CPSearchTemplateDelegateUpdateHandler completionHandler);

[Abstract]
[Async]
Copy link
Member

Choose a reason for hiding this comment

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

Same.

src/carplay.cs Outdated Show resolved Hide resolved
src/carplay.cs Outdated
}


#if false
Copy link
Member

Choose a reason for hiding this comment

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

On purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, see the linked issue: https://github.com/xamarin/maccore/issues/2298

Is it better to leave out for now until we know Apple is actually adding it?

Copy link
Contributor

Choose a reason for hiding this comment

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

either way is fine
you can add a link to the issue in the source (since the original commit message takes longer to get)

{
}

public CPMessageListItem (string identifier, string text, CPMessageListItemLeadingConfiguration leadingConfiguration, CPMessageListItemTrailingConfiguration? trailingConfiguration,
Copy link
Member

Choose a reason for hiding this comment

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

Manual code requires tests.

Copy link
Member

Choose a reason for hiding this comment

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

@whitneyschmidt this has not been fixed

src/carplay.cs Outdated
@@ -297,13 +417,15 @@ interface CPApplicationDelegate : UIApplicationDelegate {
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
[BaseType (typeof (NSObject))]
[BaseType (typeof (CPBaseListItem))]
Copy link
Member

Choose a reason for hiding this comment

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

@spouliot question about API. The class is added in iOS 14, won't this be an issue in previous versions that do have access to the class in iOS 12 and iOS 13?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mandel-macaque iirc, we saw a similar change in a recent PR.

I believe this is ok here because CPBaseListItem is a type of NSObject. Also worth noting - it looks like Apple is going to get rid of CPBaseListItem in favor of CPSelectableListItem...which isn't available and has been filed as a radar here: https://github.com/xamarin/maccore/issues/2298

[Deprecated (PlatformName.iOS, 14, 0)]
[NoWatch, NoTV, NoMac, iOS (14,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPBaseListItem : NSSecureCoding

Copy link
Contributor

Choose a reason for hiding this comment

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

@mandel-macaque it's not a problem, nor a breaking change.

We did have a bug (last year or so) where this caused an issue for 32bits code (because the new type would throw an exception as not being available on 32bits OS). This was fixed.

@@ -666,6 +676,15 @@ protected override bool Skip (Type type, string protocolName)
case "SRVisit":
case "SRWebUsage":
return true;
// Xcode 12 beta 4
Copy link
Member

Choose a reason for hiding this comment

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

beta 4 or beta 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! beta 5 :)

@spouliot spouliot mentioned this pull request Aug 24, 2020
46 tasks
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
⚠️ API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️ Generator Diff (please review changes)
🔥 Test run failed 🔥

Test results

1 tests failed, 75 tests passed.

Failed tests

  • Xtro/Mac: Failed (Test run failed.)

src/carplay.cs Outdated
Comment on lines 331 to 333
// Not sure about this one. ObjC header says: extern NSString * const CarPlayErrorDomain;
[Field ("CarPlayErrorDomain")]
NSString CarPlayErrorDomain { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, there's no enum.

grep "enum CP" *.g.cs
ios-14.0.g.cs:public enum CPAlertActionStyle : ulong
ios-14.0.g.cs:public enum CPBarButtonStyle : long
ios-14.0.g.cs:public enum CPBarButtonType : ulong
ios-14.0.g.cs:public enum CPTextButtonStyle : long
ios-14.0.g.cs:public enum CPInformationTemplateLayout : long
ios-14.0.g.cs:public enum CPListItemAccessoryType : long
ios-14.0.g.cs:public enum CPListItemPlayingIndicatorLocation : long
ios-14.0.g.cs:public enum CPNavigationAlertDismissalContext : ulong
ios-14.0.g.cs:public enum CPTripPauseReason : ulong
ios-14.0.g.cs:public enum CPPanDirection : long
ios-14.0.g.cs:public enum CPManeuverDisplayStyle : long
ios-14.0.g.cs:public enum CPTimeRemainingColor : ulong
ios-14.0.g.cs:public enum CPTripEstimateStyle : ulong
ios-14.0.g.cs:public enum CPMessageLeadingItem : long
ios-14.0.g.cs:public enum CPMessageTrailingItem : long
ios-14.0.g.cs:public enum CPLimitableUserInterface : ulong
ios-14.0.g.cs:public enum CPContentStyle : ulong

I guess one could be added later... the error domain is rarely used in code (at least for comparison). I suggest you remove it and add this (lack of related enum) in the .ignore file. If an enum is added later (beta or release) then it can be added to the right place.

src/carplay.cs Outdated
@@ -297,13 +417,15 @@ interface CPApplicationDelegate : UIApplicationDelegate {
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
[BaseType (typeof (NSObject))]
[BaseType (typeof (CPBaseListItem))]
Copy link
Contributor

Choose a reason for hiding this comment

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

@mandel-macaque it's not a problem, nor a breaking change.

We did have a bug (last year or so) where this caused an issue for 32bits code (because the new type would throw an exception as not being available on 32bits OS). This was fixed.

src/carplay.cs Outdated

[iOS (14,0)]
[Export ("indexOfItem:")]
nuint IndexOfItem (CPBaseListItem item);
Copy link
Contributor

Choose a reason for hiding this comment

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

no verb in the method, use GetIndex (CPBaseListItem item); instead

src/carplay.cs Outdated

[iOS (14,0)]
[Export ("itemAtIndex:")]
CPBaseListItem ItemAtIndex (nuint index);
Copy link
Contributor

Choose a reason for hiding this comment

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

same, use GetItem (nuint index); instead

src/carplay.cs Outdated
[iOS (14,0)]
[Export ("indexPathForItem:")]
[return: NullAllowed]
NSIndexPath IndexPathForItem (CPBaseListItem item);
Copy link
Contributor

Choose a reason for hiding this comment

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

same, GetIndexPath (CPBaseListItem item);

src/carplay.cs Show resolved Hide resolved
src/carplay.cs Show resolved Hide resolved
src/carplay.cs Outdated
[NoWatch, NoTV, NoMac, iOS (14,0)]
[Protocol]
[Model]
[BaseType (typeof (NSObject))]
Copy link
Contributor

Choose a reason for hiding this comment

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

not *Delegate
remove [Model] and [BaseType] attributes

src/carplay.cs Show resolved Hide resolved
src/carplay.cs Outdated
}


#if false
Copy link
Contributor

Choose a reason for hiding this comment

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

either way is fine
you can add a link to the issue in the source (since the original commit message takes longer to get)


namespace CarPlay {

public enum CPMessageListItemType {
Copy link
Member

Choose a reason for hiding this comment

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

Extra space:

Suggested change
public enum CPMessageListItemType {
public enum CPMessageListItemType {

"initWithFullName:phoneOrEmailAddress:leadingConfiguration:trailingConfiguration:detailText:trailingText:");
break;
default:
throw new ArgumentException ("The 'CPMessageListItemType type' argument needs a value.");
Copy link
Member

Choose a reason for hiding this comment

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

I think this is simpler and more accurate:

Suggested change
throw new ArgumentException ("The 'CPMessageListItemType type' argument needs a value.");
throw new ArgumentOutOfRangeException (nameof (type));

@whitneyschmidt whitneyschmidt added the note-highlight Worth calling out specifically in release notes label Aug 25, 2020

namespace CarPlay {

public enum CPMessageListItemType {
Copy link
Member

Choose a reason for hiding this comment

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

Availability attributes missing.

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
⚠️ API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️ Generator Diff (please review changes)
🔥 Test run failed 🔥

Test results

1 tests failed, 75 tests passed.

Failed tests

  • Xtro/Mac: Failed (Test run failed.)

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

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

Please update xtro before merging

@monojenkins
Copy link
Collaborator

Build failure
Build failed or was aborted

@whitneyschmidt whitneyschmidt changed the title [CarPlay] [Xcode 12] Update through beta 5 [CarPlay] [Xcode 12] Update through beta 6 Aug 27, 2020
@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
⚠️ API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️ Generator Diff (please review changes)
Test run succeeded

@whitneyschmidt
Copy link
Contributor Author

Build success
Build succeeded
API Diff (from stable)
⚠️ API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️ Generator Diff (please review changes)
Test run succeeded

In beta 6:

API_AVAILABLE(ios(12.0)) API_UNAVAILABLE(macos, watchos, tvos)
@interface CPListItem : NSObject <CPSelectableListItem>

The api diff in beta 1 shows:

 API_AVAILABLE(ios(12.0)) API_UNAVAILABLE(macos, watchos, tvos)
-@interface CPListItem : NSObject <NSSecureCoding>
+@interface CPListItem : CPBaseListItem

It seems that the breaking change is valid if Apple meant to remove conformance to NSSecureCoding for this type. However, that seem very strange for an API that's been available since iOS 12.

@dalexsoto
Copy link
Member

I would file an apple feedback ticked and add this to our tracking issue #8943

@spouliot
Copy link
Contributor

I agree with @dalexsoto, file an feedback with Apple. But in any case you re-add INSSecureCoding to avoid breaking changes.

@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
Test run succeeded

@whitneyschmidt whitneyschmidt merged commit efe8abd into xamarin:xcode12 Aug 28, 2020
@whitneyschmidt
Copy link
Contributor Author

#17461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues affecting Xamarin.iOS note-highlight Worth calling out specifically in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants