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

Keywords can be rendered oddly in sentry.io #67

Open
vemv opened this issue Sep 11, 2024 · 2 comments
Open

Keywords can be rendered oddly in sentry.io #67

vemv opened this issue Sep 11, 2024 · 2 comments

Comments

@vemv
Copy link

vemv commented Sep 11, 2024

Given a call approximately like this: (sentry-clj.core/send-event {:extra {::args [:handle-coercion-exception]}}), that keyword can be rendered like this on web:

Image

It's as if the keyword was JSON-encoded as the underlying object. This doesn't always happen - other keywords render just fine.

Does it sound familiar?

Thanks - V

sjamaan added a commit to sjamaan/sentry-clj that referenced this issue Nov 27, 2024
Change java-util-hashmappify-vals to also change keywords to strings
for lone values nested under a map's direct values.

When postwalk would encounter a non-map value, the value would be
returned as-is.  This means a keyword which would be nested inside
another non-map structure would not be converted to a string.  For
maps, if the keys or values are keywords themselves, it would always
directly convert them into strings, which masked the problem.

This results in weird-looking serialization which exposes the
underlying Java Keyword object, as per getsentry#67.
dharrigan pushed a commit that referenced this issue Nov 28, 2024
* Ensure all keywords are stringified by java-util-hashmappify-vals

Change java-util-hashmappify-vals to also change keywords to strings
for lone values nested under a map's direct values.

When postwalk would encounter a non-map value, the value would be
returned as-is.  This means a keyword which would be nested inside
another non-map structure would not be converted to a string.  For
maps, if the keys or values are keywords themselves, it would always
directly convert them into strings, which masked the problem.

This results in weird-looking serialization which exposes the
underlying Java Keyword object, as per #67.

* Simplify java-util-hashmappify-vals function

Instead of doing the map? test twice, do it once, using postwalk.
Postwalk already traverses all objects depth-first, so there's no need
to test for map? again in the inner "f" function.

To preserve existing functionality, use walk on the outer map (or
whatever object) to prevent it from being converted to a HashMap.

Add a test for the class of the resulting value and nested values to
ensure the functionality is still as before.
@dharrigan
Copy link
Collaborator

I think 7.18.221 now addresses this issue :-)

-=david=-

@vemv
Copy link
Author

vemv commented Nov 28, 2024

Nice! I'll give it a try

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

2 participants