Skip to content

Commit f42d972

Browse files
authored
Fix: Add user setter back in the scope (#883)
1 parent 5eda023 commit f42d972

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
* Fix: Add user setter back in the scope (#883)
56
* Fix: clear method sets all properties synchronously (#882)
67

78
## 6.6.0-beta.1

dart/lib/src/scope.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ class Scope {
5353
/// Get the current user.
5454
SentryUser? get user => _user;
5555

56+
/// Sets the current user
57+
/// This method is deprecated, use the [setUser(user)] instead.
58+
/// This method will be removed in the future.
59+
/// The breaking change is due to the [enableScopeSync] feature that
60+
/// requires returning a [Future].
61+
@Deprecated('Use [setUser(user)] instead')
62+
set user(SentryUser? user) {
63+
_user = user;
64+
}
65+
5666
void _setUserSync(SentryUser? user) {
5767
_user = user;
5868
}
@@ -139,7 +149,7 @@ class Scope {
139149

140150
List<SentryAttachment> get attachments => List.unmodifiable(_attachments);
141151

142-
@Deprecated('Use attachments instead')
152+
@Deprecated('Use [attachments] instead')
143153
List<SentryAttachment> get attachements => attachments;
144154

145155
Scope(this._options);

0 commit comments

Comments
 (0)