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

Allow suppressing reserved prefix warning #220

Open
kkostov opened this issue Dec 16, 2024 · 4 comments · May be fixed by #221
Open

Allow suppressing reserved prefix warning #220

kkostov opened this issue Dec 16, 2024 · 4 comments · May be fixed by #221
Assignees

Comments

@kkostov
Copy link

kkostov commented Dec 16, 2024

As the Flutter SDK adds and updates additional parameters when preparing signals, please allow for a way to suppress the reserved namespace warning for "legitimate uses":

message: "Sending signal with reserved prefix 'TelemetryDeck.' will cause unexpected behavior. Please use another prefix instead."

This is related to #219, tracked in TelemetryDeck/FlutterSDK#23

@Jeehut
Copy link
Contributor

Jeehut commented Dec 17, 2024

@kkostov Hmm, that warning was a feature request by users. I'm not entirely sure if it is still relevant after the Grand Rename since it's impossible that a user accidentally writes "TelemetryDeck." as a prefix. So I see 3 ways out of this here:

  1. We remove the warnings for any parameters starting with TelemetryDeck. while keeping them for old params.
  2. We find a way the Flutter SDK can use the internalSignal method which already bypasses these warnings without making it public for everyone.
  3. We define some kind of explicit way to suppressing the warnings without documenting it loudly. Maybe even a "secret" parameter like TelemetryDeck.Flutter.supressWarnings that the Swift SDK would remove when detected so we don't add any confusing public API.

I'm personally leaning towards the first suggestion as it's the simplest without real drawbacks. But it will not work if you are also sending/overriding the old parameters alongside the existing ones as a dual approach like we do in the Swift SDK.

@kkostov
Copy link
Author

kkostov commented Dec 17, 2024

it's impossible that a user accidentally writes "TelemetryDeck."

Is there a mechanism to prevent them from doing that? afaik the parameters are open to arbitrary values, e.g. one can easily append TelemetryDeck.SDK.version if they wanted to. And maybe that's okay?

supressWarnings: I don't feel the need to hide this option, the Flutter SDK is currently needing it but we can see it being useful for other SDKs e.g. Kotlin Multiplatform or React Native, etc so I wouldn't namespace it to a specific SDK either.

Perhaps we can make it part of the starting configuration for TelemetryDeck? It's debug/logging adjacent and we already have the options of these. Perhaps it makes sense to also include warning configuration?

@Jeehut
Copy link
Contributor

Jeehut commented Dec 23, 2024

Is there a mechanism to prevent them from doing that? afaik the parameters are open to arbitrary values, e.g. one can easily append TelemetryDeck.SDK.version if they wanted to. And maybe that's okay?

Please note the "accidentally" in my sentence, of course there's nothing to prevent from users doing that, even with warnings enabled users can still do that. But I wouldn't consider it "accidental" when somebody explicitly writes "TelemetryDeck." as a prefix. That's what I meant. And yeah, if they override, it's their problem. I think having the warnings in the old params is important though as it's easily possible somebody uses them for other things in their app which breaks out built-in stats.

supressWarnings: I don't feel the need to hide this option, the Flutter SDK is currently needing it but we can see it being useful for other SDKs e.g. Kotlin Multiplatform or React Native, etc so I wouldn't namespace it to a specific SDK either.

Perhaps we can make it part of the starting configuration for TelemetryDeck? It's debug/logging adjacent and we already have the options of these. Perhaps it makes sense to also include warning configuration?

Yeah, we could make such a setting independent of SDKs. I agree that adding an option but simply not mentioning it anywhere in our documentation is a good approach that prevents accidentally turning it off while making it easy for other SDKs to use.

I'm hearing out that you prefer approach 3, just not with the "secret" aspect of it. I assume approach 1 would not work because you'd also want to override old parameter names with your values. Then I'll make sure to add such setting.

@Jeehut
Copy link
Contributor

Jeehut commented Dec 23, 2024

@kkostov I just created #221 which adds a new setting to the config named reservedParameterWarningsEnabled. Just set it to false to suppress warnings once it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants