Skip to content

fix: handling of empty discord client event messages#3264

Open
Ziinc wants to merge 2 commits intomainfrom
fix/discord-client-empty-event-message
Open

fix: handling of empty discord client event messages#3264
Ziinc wants to merge 2 commits intomainfrom
fix/discord-client-empty-event-message

Conversation

@Ziinc
Copy link
Copy Markdown
Contributor

@Ziinc Ziinc commented Mar 10, 2026

GenServer {Logflare.Backends.SourceRegistry, {xxxx, Logflare.Sources.Source.WebhookNotificationServer}} terminating ** (FunctionClauseError) no function clause matching in String.split_at/2 
(elixir 1.19.5) lib/string.ex:700: String.split_at(nil, 1018) 
(logflare 1.34.13) lib/logflare/sources/source/webhook_notification_server/discord_client.ex:102: Logflare.Sources.Source.WebhookNotificationServer.DiscordClient.discord_event_message/1 
(elixir 1.19.5) lib/enum.ex:1688: Enum."-map/2-lists^map/1-1-"/2 
(logflare 1.34.13) lib/logflare/sources/source/webhook_notification_server/discord_client.ex:31: Logflare.Sources.Source.WebhookNotificationServer.DiscordClient.post/4 
(logflare 1.34.13) lib/logflare/sources/source/webhook_notification_server/webhook_notification_server.ex:50: Logflare.Sources.Source.WebhookNotificationServer.handle_info/2 
(stdlib 6.2.2.2) gen_server.erl:2345: :gen_server.try_handle_info/3 
(stdlib 6.2.2.2) gen_server.erl:2433: :gen_server.handle_msg/6 
(stdlib 6.2.2.2) proc_lib.erl:340: :proc_lib.wake_up/3 Last message: :check_rate

@Ziinc Ziinc requested a review from amokan March 10, 2026 08:32
Copy link
Copy Markdown
Contributor

@amokan amokan left a comment

Choose a reason for hiding this comment

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

Looks good and so sorry for the delay on this @Ziinc

Minor comment below about a guard we have for the binary not empty string check.


event_message =
case x.body["event_message"] do
msg when is_binary(msg) and msg != "" -> msg
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth noting that we have the is_non_empty_binary guard in Logflare.Utils.Guards

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.

2 participants