Skip to content

Conversation

@raulpe7eira
Copy link
Contributor

🐞 Problem

The google_cloud formatter crashes when it receives a crash log where the user context contains values that are not binaries (e.g., integers). This happens because the formatter uses the <> operator for string concatenation, which raises an error when used with non-binary types.

Truncated example of a crashed log:

2025-01-01T01:01:01.000000+00:00 error: FORMATTER CRASH: {string,<<"** (Postgrex.Error) ERROR 428...

✅ Solution

This PR replaces the use of the <> operator with Enum.join/2 when formatting key-value pairs. This approach safely converts all values to strings before concatenation, preventing crashes when values are not binaries.

@raulpe7eira raulpe7eira changed the title fix(google-cloud): format-affected-user/1 with non-binary values fix(google-cloud): format-affected-user/1 with non-binary values Jul 3, 2025
@raulpe7eira raulpe7eira changed the title fix(google-cloud): format-affected-user/1 with non-binary values fix(google-cloud): format_affected_user/1 with non-binary values Jul 3, 2025
@AndrewDryga
Copy link
Member

Thank you! I left one small comment and LGTM

@coveralls
Copy link

coveralls commented Jul 7, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling 84e1229 on raulpe7eira:fix/format-affected-user-with-integer-values
into 6e77680 on Nebo15:master.

Copy link
Member

@AndrewDryga AndrewDryga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AndrewDryga AndrewDryga merged commit 88a149b into Nebo15:master Jul 8, 2025
6 checks passed
@georgeguimaraes
Copy link

@AndrewDryga Hi, can you release a new version?

@AndrewDryga
Copy link
Member

@georgeguimaraes Sure, I just pushed it. Sorry for the long wait.

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 this pull request may close these issues.

4 participants