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

Repository example doesn't remove obfuscation for web #1615

Closed
ygotthilf opened this issue Aug 29, 2023 · 7 comments · Fixed by #1766
Closed

Repository example doesn't remove obfuscation for web #1615

ygotthilf opened this issue Aug 29, 2023 · 7 comments · Fixed by #1766
Assignees

Comments

@ygotthilf
Copy link

Platform

Flutter Web

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[✓] Flutter (Channel stable, 3.10.5, on macOS 13.3.1 22E772610a darwin-arm64, locale en-FR)
• Flutter version 3.10.5 on channel stable at /Users/yg/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (3 months ago), 2023-06-13 15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/yg/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.12.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.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 11.0.11+0-b60-7772763)

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

[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E772610a darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.110

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

• No issues found!

Version

7.9.0

Steps to Reproduce

  1. Create a new project on Sentry
  2. Clone this repo
  3. Open the flutter/example folder in your favorite IDE
  4. Change the DSN in the lib/main.dart
  5. Change the org property in the pubspec.yaml
  6. Run ./run.sh web
  7. Click on a bouton in the opened app

Expected Result

The stacktrace should be not obfuscated in Sentry, but it is. I have tried the example because I have the same problem in my project. But both didn't work :/

Please note the example uploads two releases and cannot link the source map to the release of the exception.

Actual Result

Screenshot 2023-08-29 at 10 24 31 Screenshot 2023-08-29 at 10 24 22 Screenshot 2023-08-29 at 10 23 51

Are you willing to submit a PR?

No

@buenaflor
Copy link
Contributor

Thank you for the issue, we will look into this

@getsantry getsantry bot removed the status in GitHub Issues with 👀 Sep 1, 2023
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Sep 1, 2023
@denrase denrase self-assigned this Sep 5, 2023
@denrase denrase moved this from Needs Investigation to In Progress in Mobile & Cross Platform SDK Sep 5, 2023
@denrase
Copy link
Collaborator

denrase commented Sep 12, 2023

@buenaflor While I can reproduce, i'm not sure how to resolve this. Lets discuss this in person.

@denrase
Copy link
Collaborator

denrase commented Sep 13, 2023

We have the same behaviour on version 7.0.0 of the SDK. Could not run lower version without changing code/dependencies.

@denrase denrase moved this from In Progress to Blocked in Mobile & Cross Platform SDK Sep 26, 2023
@denrase
Copy link
Collaborator

denrase commented Oct 3, 2023

Linking #1565 here, as it is relevant for this issue.

@buenaflor
Copy link
Contributor

Web deobfuscation on a new flutter project works for me. However I can reproduce this error in the sample app. Do you have more information on why this might be happening in the sample? @denrase

@denrase
Copy link
Collaborator

denrase commented Oct 24, 2023

@buenaflor Unfortunately I don't have more info on this. If it works for new projects, I don't see a reason why this is not working in our samaple app except that the SDK config might be different.

@buenaflor buenaflor moved this from Blocked to Backlog in Mobile & Cross Platform SDK Nov 29, 2023
@buenaflor buenaflor moved this from Backlog to Todo in Mobile & Cross Platform SDK Nov 29, 2023
@buenaflor
Copy link
Contributor

I identified the error.

run.sh creates a release based on the current date and the plugin will automatically attach the current version to it.

image

However the SDK itself will only create a release with the date without attaching the sdk version.

So there's a mismatch in sdk release and the release created from the dart plugin.

The fix is to add the version automatically similar to this:

VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
CURRENT_DATE=$(date +%Y-%m-%d_%H-%M-%S)

export SENTRY_RELEASE="$CURRENT_DATE"@"$VERSION"

I'll open a PR for that

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.

3 participants