Skip to content

Harden metrics disabled checks for caller/ancestor chains#51

Merged
DylanBlakemore merged 1 commit intomasterfrom
nil_pid
Feb 5, 2026
Merged

Harden metrics disabled checks for caller/ancestor chains#51
DylanBlakemore merged 1 commit intomasterfrom
nil_pid

Conversation

@DylanBlakemore
Copy link
Collaborator

Description

  • Prevent function_clause crashes by making ContextRegistry.disabled?/1 safely handle pids, atoms, nil, and unexpected terms.
  • Normalize the caller/ancestor chain in Context.metrics_disabled?/0 by flattening and filtering to valid types before checking.
  • Add regression tests covering nested $callers/$ancestors, mixed invalid terms, and atom ancestors.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my changes work
  • New and existing unit tests pass locally with my changes

@DylanBlakemore DylanBlakemore merged commit 0736767 into master Feb 5, 2026
3 checks passed
@DylanBlakemore DylanBlakemore deleted the nil_pid branch February 5, 2026 09:25
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