fix: don't MARKREAD when the user has no account#205
Conversation
draft/read-marker is keyed to the user's account on the server, so firing MARKREAD without a logged-in account just trips the server's "Account required for MARKREAD" FAIL. The cap-only gate at the two MARKREAD send sites (channel select + PM open) didn't catch this -- the cap is acked the moment the connection negotiates, well before the user has authenticated (or for users who never log in at all). Add an account check: ircClient.getCurrentUser(serverId)?.account must be set before we send the MARKREAD line. Account-notify will push the marker request later if the user logs in mid-session.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Automated deployment preview for the PR in the Cloudflare Pages. |
Summary
Users without a logged-in account were seeing FAIL replies like "Account required for MARKREAD" when selecting channels / opening PMs. The read-marker is keyed to the user's account on the server, so without an account there's nothing to persist anyway.
The two MARKREAD send sites in src/store/index.ts:2025 (channel select) and src/store/index.ts:2233 (PM open) only gated on the `draft/read-marker` cap being acked. The cap is negotiated up-front, well before authentication completes (or never, for users who don't log in at all), so we were firing MARKREAD on every channel/PM activation regardless of account status.
Fix
Also require `ircClient.getCurrentUser(serverId)?.account` to be set before sending MARKREAD. The account field is populated by account-tag / extended-join / WHO once SASL completes; for unauthenticated users it stays empty.
Test plan