Conversation
Finding out which commands an action issues meant reading the source or opening a MONITOR session, which shows every client's traffic and slows the server down. The browser now has a third panel listing the commands RedisInsight itself sent, grouped by the action that triggered them: - the Redis client classes report every command they send, so only RedisInsight's own traffic is recorded - a global interceptor puts the operation name into an async context, which the client reads when it logs a command - entries are pushed over socket.io to a room per instance - buffers are decoded as UTF-8 when they hold text, so key names stay readable; genuinely binary payloads fall back to a size placeholder - the panel groups consecutive commands from one action and collapses repeated lines Batches are capped so a single action cannot flood the panel.
…ance Three problems reported by the automated review: - `serializeArgument` decoded every buffer in full and scanned the whole string before truncating, on the Redis send path. A large value would stall the event loop for output that is truncated to 120 characters anyway; buffers beyond `MAX_DECODED_BUFFER_BYTES` are now reported by size. The Uint8Array branch checks the length before `Buffer.from`, which would otherwise duplicate the whole array. - A socket that reconnected while the panel was paused emitted Subscribe unconditionally, so commands started flowing again although the button still said resume. The reconnect handler now reads the pause state from a ref. - Switching instances reconnected the socket without clearing the entries, so commands from the previous database stayed in the panel. The effect now resets the buffer and the store when instanceId changes.
Follow-up on the review of the previous fix: - Clearing the entries on every mount wiped the log whenever the panel was hidden and shown again (fullscreen mode, collapsed panels). The reset now only runs when the panel actually switches to another instance. - The default panel sizes no longer add up to 100% once the command log is hidden, and persisted two-column sizes overflow when the third panel is rendered. The defaults are now rescaled to the panels that are actually visible.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b3a1c68. Configure here.
| ) | ||
| }) | ||
| socket.on(SocketEvent.ConnectionError, () => { | ||
| dispatch(setCommandLogError(t('browser.commandLog.error.connection'))) |
There was a problem hiding this comment.
Connection error never clears
Low Severity
setCommandLogError runs on exception and ConnectionError, but neither a successful reconnect nor concatCommandLogEntries clears error. After a transient socket failure, clearing the list still shows “Connection lost” instead of the empty placeholder even though commands are flowing again.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b3a1c68. Configure here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
The browser gets a third panel that lists the Redis commands RedisInsight
itself sent, grouped by the action that triggered them, so you can see what a
click actually does.
Why
Today the only way to see the commands behind an action is to read the source
or run
MONITOR.MONITORstreams every client's traffic and has a realperformance cost on the server, so it is not something you leave on while
learning.
This records only RedisInsight's own commands, at the point they are sent.
How it works
RedisClientgains a static handler and aprotected logCommands()that the ioredis and node-redis clients call rightbefore sending. Nothing is recorded unless a handler is installed, and the
client layer keeps zero imports from the command-log module.
OperationContextInterceptorruns each HTTPrequest inside an
AsyncLocalStoragethat carries a human readableoperation name (
Load key details,Delete key, …). The client reads itwhen logging, so every command is attributed to the action that caused it.
the existing socket configuration.
bulk action cannot flood the panel.
Buffers. Decoding them as UTF-8 when they hold text (and only falling backto a
<binary N bytes>placeholder for genuinely binary payloads) is whatmakes the panel useful — otherwise the most informative part of every
command is hidden.
UI
command-log-panelon the browser page, in a third resizable column.the operation name and a count; repeated identical lines collapse to
×N.Changes
Backend
api/src/modules/command-log/— new module (entry model, serialisation,service, socket.io gateway).
api/src/common/context/operation.context.ts,api/src/common/interceptors/operation-context.interceptor.ts— new.api/src/modules/redis/client/**— hook in the ioredis and node-redisclients.
api/src/app.module.ts,api/src/main.ts— register the module and theglobal interceptor.
Frontend
ui/src/slices/browser/commandLog.ts— new slice.ui/src/pages/browser/components/command-log-panel/— new panel.ui/src/pages/browser/BrowserPage.tsx— third column.ui/src/i18n/locales/{en,bg}.json— 7 new keys.Tests
CommandLogList.spec.tsx(new, 10 cases) — grouping by operation, a newgroup when the operation changes or the gap is too large, collapsing
repeated lines, non-adjacent repeats stay separate.
operation name and database, key names stay readable, and commands from
another client are not recorded (which is the point versus
MONITOR).Screenshots
The panel after clicking a key — note the readable key names:
Notes for reviewers
problem can never break the command itself.
at 50 commands); nothing is persisted.
fit the roadmap.
Note
Medium Risk
Touches the Redis client send path on every command (wrapped in try/catch) and adds a global HTTP interceptor; failures are designed to be best-effort but any regression could affect performance or request handling.
Overview
Adds a Browser command log that shows Redis commands RedisInsight itself sends, grouped by the UI action that triggered them—without using
MONITOR.On the API, a new
CommandLogModulebuffers serialized commands from a static hook onRedisClient(ioredis and node-redis call sites), batches them, and streams per-instance rooms over a dedicated Socket.IO namespace. A globalOperationContextInterceptorbinds human-readable operation labels viaAsyncLocalStorageso each logged command is attributed to the HTTP handler (e.g. “Load key list”). Serialization truncates large/binary args on the hot path so logging cannot block or break command execution.The Browser page gains a third resizable column with
CommandLogPanel: live socket subscription, pause/resume/clear, Redux state capped at 1000 entries, and list UI that groups by operation and collapses repeated lines. Layout logic normalizes persisted two-panel sizes to three columns; i18n keys added for en/bg.Reviewed by Cursor Bugbot for commit b3a1c68. Bugbot is set up for automated code reviews on this repo. Configure here.