You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] BoundedMap.has() Returns false for Keys Storing undefined #738
BoundedMap.has() is implemented as return this.get(key) !== undefined. get() returns undefined for two distinct reasons: (1) the key does not exist, or (2) the key exists but its stored value is undefined. This means has() returns false for a key that was explicitly set to undefined, violating the standard Map contract where has() only reflects key existence, not value truthiness.
Environment
OS: Any
Node version: Any
Nanocoder version: Latest
Provider: N/A
Model: N/A
Steps to Reproduce
Open source/utils/bounded-map.ts.
Create a BoundedMap and call map.set('key', undefined).
Call map.has('key').
Observe it returns false despite the key being present.
Expected Behavior
map.has('key') should return true when the key was set, regardless of whether the value is undefined.
Actual Behavior
map.has('key') returns false because get() returns undefined and the implementation treats that as "key not found".
Logs/Screenshots
N/A
Additional Context
Fix: rewrite has() to check the internal Map directly and perform a manual TTL check, rather than delegating to get().
This matches how the native Map.prototype.has() behaves.
Note: This issue is intentionally kept small and is suitable for first-time contributors. If you're interested in working on it, please leave a comment below and ask to be assigned before opening a pull request.
I have searched existing issues to ensure this is not a duplicate
I can reproduce this issue consistently
This issue occurs with the latest version of nanocoder
Hi @akramcodez, I'll be glad if u assign me this task as it's within my bandwidth right now, and I've worked in this codebase before (#729). Could you assign it to me?
Activity
MsadafK commentedon Aug 1, 2026
Hi @akramcodez , I would like to work on this issue. Please assign it to me!
DeepamJha commentedon Aug 1, 2026
Hi @akramcodez, I'll be glad if u assign me this task as it's within my bandwidth right now, and I've worked in this codebase before (#729). Could you assign it to me?
akramcodez commentedon Aug 2, 2026
Hey @DeepamJha and @MsadafK, you both are already assigned to other issues. Could you please complete those first before taking on new ones? Thanks!
DeepamJha commentedon Aug 2, 2026
Yeah, both #729 and #736 are currently up waiting for review
RealBhupesh commentedon Aug 2, 2026
I would like to work on this issue. I will include a focused fix and regression coverage in a PR shortly.