Skip to content

Slack: user_cache grows unbounded in large workspaces #384

@thepagent

Description

@thepagent

Parent: #382

Problem

SlackAdapter::user_cache is a HashMap<String, (String, Instant)> with a 5-minute TTL per entry, but no max size. In a busy Slack workspace with many unique users, the cache grows indefinitely since expired entries are only evicted on cache hit (lazy eviction).

Suggested fix

Add a max entries cap (e.g. 1000). On insert, if over cap, evict the oldest entry. Alternatively, use an LRU cache crate.

Severity: low — only affects large workspaces with 1000+ unique users interacting with the bot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions