Users are fetched via SlackClient.iter_users(), which wraps users.list with
cursor-based pagination. The cache layer writes users via storage.upsert_users().
Display name resolution uses storage.load_user_display_names(), which queries only
the specific user ids needed for a given thread.
User -> cli fetch-users
-> slack_api.iter_users() -> paginated user dicts
-> storage.upsert_users() -> INSERT OR REPLACE
-> print summary
During show:
-> storage.load_user_display_names([U1, U2, ...])
-> SELECT id, name, real_name FROM users WHERE id IN (...)
-> format as "Real Name (handle)" / "handle" / "U1"
Technical Decisions
Decision
Choice
Rationale
real_name source
Top-level real_name, falling back to profile.real_name
Slack API is inconsistent about where the real name lives
Display name format
"Real Name (handle)"
Provides both the human-readable name and the unique handle
Chunk size for IN queries
900
Stays under SQLite's default 999 bound-variable limit
Upsert strategy
INSERT OR REPLACE by id
Idempotent; re-running fetch-users updates stale data
Risks and Unknowns
Large workspaces with tens of thousands of users may have slow initial fetch
Slack API may return different user object shapes across workspace types