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

Replace toImage with toImageSync for Flutter >= 3.7 #1268

Merged
merged 10 commits into from
Mar 6, 2023

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Feb 6, 2023

📜 Description

Closes #1246

💚 How did you test it?

Ran example app on Flutter 3.3.x and 3.7.x and checked if triggering error attached a screenshot.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -12.64 ⚠️

Comparison is base (c60752d) 88.73% compared to head (d079e2c) 76.10%.

❗ Current head d079e2c differs from pull request most recent head 3c94de8. Consider uploading reports for the commit 3c94de8 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           v7.0.0    #1268       +/-   ##
===========================================
- Coverage   88.73%   76.10%   -12.64%     
===========================================
  Files         122       12      -110     
  Lines        3818      318     -3500     
===========================================
- Hits         3388      242     -3146     
+ Misses        430       76      -354     
Impacted Files Coverage Δ
dio/lib/src/breadcrumb_client_adapter.dart 80.00% <ø> (ø)
dio/lib/src/sentry_dio_client_adapter.dart 83.33% <ø> (ø)
file/lib/src/sentry_file_extension.dart 80.00% <ø> (ø)
dio/lib/src/dio_error_extractor.dart 100.00% <100.00%> (ø)
dio/lib/src/dio_event_processor.dart 97.05% <100.00%> (+0.63%) ⬆️
dio/lib/src/sentry_dio_extension.dart 93.33% <100.00%> (+1.02%) ⬆️
dio/lib/src/tracing_client_adapter.dart 85.71% <100.00%> (ø)
file/lib/src/sentry_file.dart 54.13% <100.00%> (ø)
dart/lib/src/hub.dart
dart/lib/src/hub_adapter.dart
... and 110 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@denrase denrase marked this pull request as ready for review February 6, 2023 14:19
@denrase
Copy link
Collaborator Author

denrase commented Feb 6, 2023

@marandaneto Interestingly, the compiler does complain with Flutter 3.7.x, but i can run the example app and the UI tests without problems. Is this part of the "hack"?

Bildschirm­foto 2023-02-06 um 15 20 07

@marandaneto
Copy link
Contributor

@marandaneto Interestingly, the compiler does complain with Flutter 3.7.x, but i can run the example app and the UI tests without problems. Is this part of the "hack"?

Bildschirm­foto 2023-02-06 um 15 20 07

Is the compiler or just the IDE linter? if you can run, its not a compiler issue and this should be fine.

@ueman
Copy link
Collaborator

ueman commented Feb 6, 2023

@marandaneto Interestingly, the compiler does complain with Flutter 3.7.x, but i can run the example app and the UI tests without problems. Is this part of the "hack"?

Bildschirm­foto 2023-02-06 um 15 20 07

I think it complains because return (repaintBoundary as dynamic).toImageSync(pixelRatio: pixelRatio); has a return type of dynamic which gets implicitly casted to FutureOr<ui.Image>. So I would guess return (repaintBoundary as dynamic).toImageSync(pixelRatio: pixelRatio) as ui.Image; should fix that warning/error.

Calling something on dynamic disables any typechecks, so return values are dynamic too.

@marandaneto
Copy link
Contributor

@denrase this one still has pending comments

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

If CI is happy, we can merge it, thanks.

@marandaneto
Copy link
Contributor

@denrase we can fix the conflict and merge it if CI is happy

denrase and others added 2 commits March 6, 2023 14:25
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Replace `toImage` with `toImageSync` for Flutter >= 3.7 ([#1268](https://github.com/getsentry/sentry-dart/pull/1268))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 3c94de8

@marandaneto marandaneto merged commit f40b3a9 into v7.0.0 Mar 6, 2023
@marandaneto marandaneto deleted the enha/replace-to-image-with-sync branch March 6, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants