Skip to content

feat: add config field to skip auto-join WHO and MODE - #78

Merged
lrstanley merged 2 commits into
lrstanley:masterfrom
vaaleyard:disable-auto-join-who-mode
Aug 6, 2026
Merged

feat: add config field to skip auto-join WHO and MODE#78
lrstanley merged 2 commits into
lrstanley:masterfrom
vaaleyard:disable-auto-join-who-mode

Conversation

@vaaleyard

Copy link
Copy Markdown
Contributor

🚀 Changes proposed by this PR

Allow clients to disable girc's automatic self-JOIN WHO and MODE requests independently, while keeping channel/user tracking enabled to keep possible to rely on state lookups.

girc currently sends WHO <channel> and MODE <channel> whenever the client joins a channel. That is useful as the default because it hydrates channel/user and mode state eagerly.
However, some clients join many channels and already maintain enough UI/state from NAMES replies plus incremental JOIN, PART, NICK, and MODE events. For those clients, the automatic per-channel WHO/MODE burst can be a significant startup cost.

DisableTracking() is not a good fit for this case because it disables too much: I would still need LookupChannel, LookupUser, IsInChannel, etc.

So, this change adds two independent config fields:

  • DisableAutoWhoOnJoin
  • DisableAutoModeOnJoin

Both default to false, preserving existing behavior. When enabled, they only suppress the automatic requests sent after the client’s own JOIN. Tracking remains enabled and can still be populated by NAMES replies and subsequent channel events.

🧰 Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that causes existing functionality to not work as expected).
  • This change requires (or is) a documentation update.

📝 Notes to reviewer

🤝 Requirements

  • 💬 My changes as properly commented, primarily for hard-to-understand areas.
  • 📝 I have made corresponding changes to the documentation.
  • 🧪 I have included tests (if necessary) for this change.

Allow clients to disable girc's automatic self-JOIN WHO and MODE requests independently, while keeping channel/user tracking enabled for consumers that rely on state lookups.

Signed-off-by: Leonardo Essia <leonardo@essia.dev>
Comment thread client.go Outdated
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.64%. Comparing base (e3e8859) to head (5d0a04e).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   54.21%   54.64%   +0.42%     
==========================================
  Files          16       16              
  Lines        3626     2758     -868     
==========================================
- Hits         1966     1507     -459     
+ Misses       1540     1122     -418     
- Partials      120      129       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lrstanley
lrstanley merged commit 29ccd10 into lrstanley:master Aug 6, 2026
11 checks passed
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