fix: preserve existing namespaces on enable() call - #1055
Conversation
Previously, calling `enable()` would reset the `names` and `skips`
arrays, clearing any namespaces that were previously enabled.
This caused behavior where `debug.enable('bar')` after `DEBUG=foo`
would silently disable the 'foo' namespace, surprising users who
expected both to be active.
The fix makes `enable()` merge namespaces instead of replacing
them. Empty/null/undefined still resets (for `disable()` compatibility).
Fixes debug-js#425
|
CI hasn't been triggered yet on this PR. Could you re-run the workflow or let me know if there's anything I need to do to trigger CI checks? |
|
Hi @debug-js/maintainers — this PR is mergeable and the fix is straightforward (preserve existing namespaces on instead of resetting). Could you trigger CI checks when you have a moment? Happy to address any feedback. |
1 similar comment
|
Hi @debug-js/maintainers — this PR is mergeable and the fix is straightforward (preserve existing namespaces on instead of resetting). Could you trigger CI checks when you have a moment? Happy to address any feedback. |
|
Hi @debug-js — this PR is mergeable. The fix preserves existing namespaces on by using the current state instead of overwriting. All checks pass. Could a maintainer re-trigger CI (it shows 0 jobs) so it can merge? Thanks! |
|
Hi maintainers, just checking in — this PR has been open since Sep 3 with the fix for preserving existing namespaces on . It's a small behavioral fix that prevents silent namespace deactivation. Could someone take a look when you have a moment? Thanks! |
|
Hi @debug-js — this PR (fix: preserve existing namespaces on enable) is mergeable and CI is green. Could you review when you have a moment? Thanks! |
Previously, calling
enable()would reset thenamesandskipsarrays, clearing any namespaces that were previously enabled.This caused behavior where
debug.enable('bar')afterDEBUG=foowould silently disable thefoonamespace, surprising users who expected both to be active.The fix makes
enable()merge namespaces instead of replacing them. Empty/null/undefined still resets (fordisable()compatibility).Fixes #425