-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Closed
flutter/packages
#4289Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: fatal crashCrashes that terminate the processCrashes that terminate the processc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12Found to occur in 3.12has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specifically
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
- Using pigeon
10.0.1 - Run swift generator for schema:
@FlutterApi()
abstract class NativeAuthPlugin {
@async
NativeAuthSession fetchAuthSession();
}
class NativeAuthSession {
late bool isSignedIn;
String? userSub;
NativeUserPoolTokens? userPoolTokens;
String? identityId;
NativeAWSCredentials? awsCredentials;
}
class NativeUserPoolTokens {
late String accessToken;
late String refreshToken;
late String idToken;
}
class NativeAWSCredentials {
late String accessKeyId;
late String secretAccessKey;
String? sessionToken;
String? expirationIso8601Utc;
}- Send
nullforuserPoolTokens(code from unit test)
lazy var codec = NativeAuthPluginCodec.shared
func send(
onChannel channel: String,
message: Data?,
binaryReply callback: FlutterBinaryReply? = nil
) {
let authSession = NativeAuthSession(
isSignedIn: isSignedIn,
userSub: nil,
userPoolTokens: nil,
identityId: nil,
awsCredentials: nil
)
let encodedAuthSession = codec.encode(authSession)
callback?(encodedAuthSession)
}Expected results
Passing null for userPoolTokens should work. This code worked with pigeon v9 output.
Actual results
A crash is observed running in Xcode.
Code sample
Included above.
Screenshots or Video
Logs
Logs
Test Case '-[unit_tests.NativeAuthPluginTests testFetchAuthSessionSignedIn]' started.
Could not cast value of type 'NSNull' (0x107eaa978) to 'NSArray' (0x107eaaa20).
2023-06-21 08:02:22.225474-0700 Runner[54059:310281] Could not cast value of type 'NSNull' (0x107eaa978) to 'NSArray' (0x107eaaa20).Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: fatal crashCrashes that terminate the processCrashes that terminate the processc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12Found to occur in 3.12has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specifically