Skip to content

fix: use bracket notation for statsd keyword list access in init/1#74

Merged
rkallos merged 1 commit into
rkallos:mainfrom
yordis:fix/statsd-opts-keyword-list-access
Apr 12, 2026
Merged

fix: use bracket notation for statsd keyword list access in init/1#74
rkallos merged 1 commit into
rkallos:mainfrom
yordis:fix/statsd-opts-keyword-list-access

Conversation

@yordis
Copy link
Copy Markdown
Contributor

@yordis yordis commented Apr 3, 2026

Summary

  • Fixes a BadMapError crash on startup when statsd options are configured
  • statsd_opts is a keyword list (per the Peep.Options schema: type: {:or, [nil, {:keyword_list, ...}]}), so it must be accessed with bracket notation, not dot notation
  • Line 244 in the same function already uses statsd_opts[:flush_interval_ms] correctly — line 215 was inconsistent

The bug was introduced in v5.0.0 when options was refactored from a keyword list to a %Peep.Options{} struct. The dot-notation conversion was incorrectly applied to statsd_opts, which is a keyword list field inside the struct.

Adds a regression test to assert peep starts successfully when statsd
options are configured.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the fix/statsd-opts-keyword-list-access branch from ea855ee to 45bc17b Compare April 3, 2026 20:05
@yordis
Copy link
Copy Markdown
Contributor Author

yordis commented Apr 9, 2026

hey @rkallos can you help me on this one? It is blocking the upgrading 😢

@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Apr 9, 2026

D'oh! Nice find!

I'm on vacation right now, and I get back on Saturday. I can play around, merge and release it then.

@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Apr 12, 2026

Thanks for the fix! <3

https://hex.pm/packages/peep/5.0.1

@rkallos rkallos merged commit dcfcd57 into rkallos:main Apr 12, 2026
1 check passed
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