Skip to content

Commit 710f61b

Browse files
authored
Dart: Document Scope Deprecations (#5145)
1 parent 486752e commit 710f61b

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Scope Synchronization
2+
3+
Starting with version `6.6.0` of the SDK, setting data on the Flutter `Scope` can be synced to the Android and iOS SDKs. This behavior is enabled by default and can be disabled by setting `SentryOptions.enableScopeSync` to false. The following `Scope` methods will sync and can also be awaited upon:
4+
- `setContexts`
5+
- `removeContexts`
6+
- `setUser`
7+
- `addBreadcrumb`
8+
- `clearBreadcrumbs`
9+
- `setExtra`
10+
- `removeExtra`
11+
- `setTag`
12+
- `removeTag`

src/platforms/common/configuration/options.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ If the callback is not set, or it returns `undefined`, the default naming scheme
430430
<ConfigKey name="enabled" supported={["javascript", "node"]}>
431431

432432
Specifies whether this SDK should send events to Sentry. Defaults to `true`. Setting this to `enabled: false` doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely, depending on environment, call `Sentry.init` conditionally.
433-
433+
434434
</ConfigKey>
435435

436436
<ConfigKey name="send-client-reports" supported={["java", "javascript", "dotnet", "python", "dart", "apple"]} notSupported={["react-native"]}>
@@ -660,4 +660,10 @@ Set this callback, which is called after the Sentry React Native SDK initializes
660660

661661
</ConfigKey>
662662

663+
<ConfigKey name="enableScopeSync" supported={["flutter"]}>
664+
665+
Set this boolean to `false` to disable sync of `Scope` data to Android and iOS SDKs.
666+
667+
</ConfigKey>
668+
663669
</PlatformSection>

src/platforms/common/enriching-events/scopes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You can also apply this configuration when unsetting a user at logout:
8484

8585
</PlatformSection>
8686

87-
<PlatformSection supported={["android"]}>
87+
<PlatformSection supported={["android", "flutter"]}>
8888

8989
<PlatformContent includePath="enriching-events/scopes/scope-synchronization" />
9090

src/platforms/dart/migration.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ Future<void> main() async {
1616
}
1717
```
1818

19+
- The `Scope.user` setter was deprecated in favor of `Scope.setUser`, and it will be removed in a future update.
20+
21+
- The `Scope.attachements` getter was deprecated in favor of `attachments`, and it will be removed in a future update.
22+
23+
- The following `Scope` methods now return `Future<void>` instead of `void`:
24+
- `setContexts`
25+
- `removeContexts`
26+
- `setUser`
27+
- `addBreadcrumb`
28+
- `clearBreadcrumbs`
29+
- `setExtra`
30+
- `removeExtra`
31+
- `setTag`
32+
- `removeTag`
33+
1934
### Sentry Self-hosted Compatibility
2035

2136
- Starting with version `6.6.0` of `sentry`, [Sentry's version >= v21.9.0](https://github.com/getsentry/self-hosted/releases) is required or you have to manually disable sending client reports via the `sendClientReports` option. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed.

0 commit comments

Comments
 (0)