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

App Replay Type Error: "'Null' is not a subtype of type 'String'" #2412

Closed
Swepilot opened this issue Nov 15, 2024 · 9 comments · Fixed by #2452
Closed

App Replay Type Error: "'Null' is not a subtype of type 'String'" #2412

Swepilot opened this issue Nov 15, 2024 · 9 comments · Fixed by #2452

Comments

@Swepilot
Copy link

Platform

Flutter Mobile

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale en-SE)
• Flutter version 3.24.3 on channel stable at /opt/homebrew/Caskroom/flutter/2.10.0/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (9 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/xxx/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.16.2

[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[✓] VS Code (version 1.95.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.100.0

[✓] Network resources
• All expected network resources are available.

• No issues found!

Version

8.10.1

Steps to Reproduce

Run a Flutter app which is configured to use the beta feature App Replay

Expected Result

No TypeError

Actual Result

_TypeError (type 'Null' is not a subtype of type 'String' in type cast) on line

}).then((value) => SentryId.fromId(value as String));

Are you willing to submit a PR?

None

@buenaflor
Copy link
Contributor

hi how does your init config look like?

@Swepilot
Copy link
Author

hi how does your init config look like?

@buenaflor like this:

 await SentryFlutter.init((options) {
    options.dsn =
        'https://........ingest.sentry.io/.......';

    // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
    // We recommend adjusting this value in production.
    options.tracesSampleRate = 1.0;

    options.experimental.replay.sessionSampleRate = 1.0;
    options.experimental.replay.onErrorSampleRate = 1.0;

  }, appRunner: () => runApp(App()));

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 15, 2024
@nelsoncampos-cloudwalk
Copy link

Same issue here for me

@buenaflor
Copy link
Contributor

does this happen both on iOS and Android?

@nelsoncampos-cloudwalk
Copy link

I can confirm that is happing in iOS @buenaflor

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 18, 2024
@buenaflor
Copy link
Contributor

buenaflor commented Nov 18, 2024

I believe this issue has something to do with hot-restart, I can't reproduce it when I cold start an app but as soon as I hot-restart then the error starts popping up (which indicates the replayId is null)

@vaind maybe you know more here

@vaind
Copy link
Collaborator

vaind commented Nov 22, 2024

The issue, as mentioned by @buenaflor, happens during development when flutter does a "hot-restart". This causes our native iOS SDK (sentry-cocoa) integration to restart as well but the native replay integration doesn't restart. We'll need to make adjustments either in our calls to the native SDK or in the native SDK itself (TBD). I'll keep this issue updated when fixes are in place.

@buenaflor buenaflor moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Nov 25, 2024
@nelsoncampos-cloudwalk
Copy link

nelsoncampos-cloudwalk commented Nov 25, 2024

@vaind @buenaflor Hi there! Do you have an estimated timeline for when this fix might be completed? We're really eager to start using the Sentry Replays features.

@buenaflor
Copy link
Contributor

@nelsoncampos-cloudwalk we're working in a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants