-
-
Couldn't load subscription status.
- Fork 460
Hubs/Scopes Merge 33 - No longer replace global scope #3362
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
Changes from all commits
305baf5
95f5e1b
27f2398
ce3c14f
ce615f4
22ddc00
305c217
da927bc
8279276
9bfc086
b998e50
739827a
69f2d63
792d482
9bcbce6
3f25a4b
d6fb40a
7752bcc
1e329c5
b0d89ae
cdd414a
98da9ff
2d26033
bbb6700
c714b21
a474402
ae93e33
b01298b
b64e688
d06fc50
f0af5c3
2f02001
bf4a7bf
62cb91a
b1630ea
136b9ce
94d54ef
017599d
0b5a5a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,10 @@ | |
| /** Sentry initialization class */ | ||
| public final class SentryAndroid { | ||
|
|
||
| static { | ||
| Sentry.getGlobalScope().replaceOptions(new SentryAndroidOptions()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe @romtsn can recall exactly, but I think creating options can be expensive. There's also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, might be a good idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC we discussed that this is not required, as any integrations / processors will access the |
||
| } | ||
|
|
||
| // SystemClock.uptimeMillis() isn't affected by phone provider or clock changes. | ||
| private static final long sdkInitMillis = SystemClock.uptimeMillis(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ public final class Scope implements IScope { | |
| private @NotNull List<String> fingerprint = new ArrayList<>(); | ||
|
|
||
| /** Scope's breadcrumb queue */ | ||
| private final @NotNull Queue<Breadcrumb> breadcrumbs; | ||
| private volatile @NotNull Queue<Breadcrumb> breadcrumbs; | ||
|
|
||
| /** Scope's tags */ | ||
| private @NotNull Map<String, @NotNull String> tags = new ConcurrentHashMap<>(); | ||
|
|
@@ -66,7 +66,7 @@ public final class Scope implements IScope { | |
| private @NotNull List<EventProcessorAndOrder> eventProcessors = new CopyOnWriteArrayList<>(); | ||
|
|
||
| /** Scope's SentryOptions */ | ||
| private final @NotNull SentryOptions options; | ||
| private volatile @NotNull SentryOptions options; | ||
|
|
||
| // TODO Consider: Scope clone doesn't clone sessions | ||
|
|
||
|
|
@@ -1038,6 +1038,23 @@ public void setSpanContext( | |
| } | ||
| } | ||
|
|
||
| @ApiStatus.Internal | ||
| @Override | ||
| public void replaceOptions(final @NotNull SentryOptions options) { | ||
| // TODO [HSM] check if already enabled and noop in that case? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be used after |
||
| // if (!isEnabled()) {} | ||
| this.options = options; | ||
| final Queue<Breadcrumb> oldBreadcrumbs = breadcrumbs; | ||
| breadcrumbs = createBreadcrumbsList(options.getMaxBreadcrumbs()); | ||
| for (Breadcrumb breadcrumb : oldBreadcrumbs) { | ||
| /* | ||
| this should trigger beforeBreadcrumb | ||
| and notify observers for breadcrumbs added before options where customized in Sentry.init | ||
| */ | ||
| addBreadcrumb(breadcrumb); | ||
| } | ||
| } | ||
|
|
||
| /** The IWithTransaction callback */ | ||
| @ApiStatus.Internal | ||
| public interface IWithTransaction { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way, if a user adds, e.g. tags to global scope, cross platform SDKs will also receive the tag.