Skip to content

User assigned values for CrashedLastRun, EnableScopeSync and ScopeObserver are ignored #4529

@jamescrosswell

Description

@jamescrosswell

Originally posted by @jamescrosswell in #4521 (comment)

CrashedLastRun, EnableScopeSync and ScopeObserver get overwritten when initialising the Native, iOS and Android integrations... e.g.

// Set options for the managed SDK that depend on the Cocoa SDK. (The user will not be able to modify these.)
options.AddEventProcessor(new CocoaEventProcessor());
options.CrashedLastRun = () => SentryCocoaSdk.CrashedLastRun;
options.EnableScopeSync = true;
options.ScopeObserver = new CocoaScopeObserver(options);

options.CrashedLastRun = () => JavaSdk.Sentry.IsCrashedLastRun()?.BooleanValue() is true;
options.EnableScopeSync = true;
options.ScopeObserver = new AndroidScopeObserver(options);

Any user configured values for these will get overwritten/ignored.

If that's what we want, those options should probably be internal (not public).

Alternatively we should respect the value that the user assigns to EnableScopeSync and chain/wrap the CrashedLastRun and ScopeObserver delegates so that both the user's code and ours get executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net code

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions