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

Disable SDK if initialized without a [valid] DSN #2712

Open
armcknight opened this issue Feb 21, 2023 · 2 comments
Open

Disable SDK if initialized without a [valid] DSN #2712

armcknight opened this issue Feb 21, 2023 · 2 comments

Comments

@armcknight
Copy link
Member

Description

If the SDK is initialized with out a DSN, or an invalid one, then it will never be able to upload data for use by customers. But, as of today, it will still gather that data by installing its various runtime mechanisms. This incurs a performance cost with no benefit.

We will even state in a log message that the SDK failed to initialize here:

logWithMessage:[NSString stringWithFormat:@"Failed to initialize: %@", *error]

Which isn't quite accurate because methods like startTransaction and swizzleInstanceMethod will still operate, which I wouldn't expect with an uninitialized SDK. For those and other top-level methods, we should check whether the SDK was successfully initialized before proceeding.

That log method should also explicitly state that, if not provided a valid DSN, the SDK will do no further work.

@philipphofmann
Copy link
Member

The benefit of this fix is that the running code doesn't pollute the logs. If you pass in a wrong DSN, the SDK should only print one error message that it couldn't parse the DSN, so users don't miss it.

@philipphofmann philipphofmann moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Mar 1, 2023
@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants