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

Remove or fix IUnknownPropertiesConsumer implementation #1497

Closed
marandaneto opened this issue May 28, 2021 · 3 comments
Closed

Remove or fix IUnknownPropertiesConsumer implementation #1497

marandaneto opened this issue May 28, 2021 · 3 comments
Assignees
Milestone

Comments

@marandaneto
Copy link
Contributor

marandaneto commented May 28, 2021

Relates to #1420 but can be done standalone.
The IUnknownPropertiesConsumer implementation today is different than expected, we can either fix it or remove it as the 'unknown' map that this implementation generates is usually dropped during ingestion.

Not all protocol classes accept non-mapped fields, but we implement IUnknownPropertiesConsumer for every protocol class, this should also be addressed.

It's not a high priority issue though because it only affects hybrid SDKs or when one downgrade the SDK and has a cached envelope that has now a field that is unknown.

@bruno-garcia
Copy link
Member

Is there a way to do this with the current reflection-based serialization approach? We've been reconsidering vendoring the handful Gson classes needed to do 'manual' serialization/deserialization and drop the Gson dependency. While doing so we could address this issue by keeping unknown json keys into a Map<> and serializing back into the JSON when a round-trip serialization happens.

It will hopefully address #1420 too since we wouldn't depend on Gson.

Another added benefit is to avoid the Gson version conflict that comes up from time to time:

ERROR: Request failed, API returned 400
ERROR: {"detail":"empty envelope"}.

@marandaneto
Copy link
Contributor Author

I believe it's possible to fix with the current implementation, yes, it'd require adapters for every single protocol class probably.
I'd focus on #1420 and fix this issue while doing it, which is win-win, no reflection, no gson, and doing it by hand is easy to survive unknown fields during round trip.

@marandaneto
Copy link
Contributor Author

closed by #1554

@stephanie-anderson stephanie-anderson removed the Type: Bug Something isn't working label Nov 21, 2024
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

No branches or pull requests

4 participants