Repository navigation
fix: include user updates when revoking tokens - #228
pcbeingused33 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 78ae4c9. Configure here.
| describe StreamChat::Client do | ||
| let(:client) { described_class.new('test-key', 'test-secret') } | ||
| let(:timestamp) { '2026-11-10T00:00:00+00:00' } | ||
| let(:response) { StreamChat::StreamResponse.new({}, Faraday::Response.new(status: 200, response_headers: {})) } |
There was a problem hiding this comment.
Test stub builds Faraday response incorrectly
Medium Severity
The response helper passes status and response_headers as keywords to Faraday::Response.new, but that initializer only takes an optional env. On Ruby 3 this raises ArgumentError when the lazy helper is first used, so every example errors during setup and never asserts the PATCH payload.
Reviewed by Cursor Bugbot for commit 78ae4c9. Configure here.
|
Friendly ping: could someone take a look at this when there's time? I'm happy to adjust anything. Thanks! |


CLA
Description of the pull request
revoke_users_tokenbuilds a partial update for each user withmap, but discards the resulting array and passes an emptyupdatesarray toupdate_users_partial. As a result, bothrevoke_users_tokenand its single-user wrapperrevoke_user_tokensendusers: [], so no tokens are actually revoked.Assign the mapped updates to
updatesso the PATCH request includes every requested user.Testing
New offline spec
spec/revoke_tokens_spec.rb(HTTP mocked, no API key needed) checks the PATCH payload for multiple users with aDateTime, one user with a string timestamp, and an empty list. Onmasterthe two non-empty cases fail because the payload isusers: []; with the fix all three pass.This change and its regression tests were prepared with OpenAI Codex.
Note
Medium Risk
Restores security-sensitive token revocation behavior; scope is a small payload fix with new regression specs.
Overview
revoke_users_tokenpreviously built per-user partial updates withmapbut never stored the result, soupdate_users_partialalways receivedusers: []and no tokens were revoked (including viarevoke_user_token).The fix assigns
updates = user_ids.map { ... }so each user is PATCHed withrevoke_tokens_issued_beforeafter timestamp normalization.Adds
spec/revoke_tokens_spec.rbwith mocked HTTP expectations for multi-user (DateTime), single-user (string timestamp), and empty user list payloads.Reviewed by Cursor Bugbot for commit 78ae4c9. Bugbot is set up for automated code reviews on this repo. Configure here.