fix(frontend): prevent crash on ? keypress with vanilla Kafka#2274
Open
fix(frontend): prevent crash on ? keypress with vanilla Kafka#2274
? keypress with vanilla Kafka#2274Conversation
Three interacting bugs caused React error #301 (too many re-renders) when pressing `?` on a console instance connected to vanilla Kafka: - setup({}) was called on every render with a new object, defeating memoizeOne's reference equality check - listEnterpriseFeatures lacked a .catch() handler, causing unhandled rejections (501) on vanilla Kafka that cascaded into re-render loops - useKey('?') maintained unnecessary pressed state triggering App re-renders even though the callback is a no-op in production
malinskibeniamin
approved these changes
Mar 9, 2026
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.
Summary
Fixes #2262 — pressing
?crashes the console with React error #301 (too many re-renders) when connected to vanilla Kafka without Redpanda Admin API.Three interacting bugs caused the crash:
setup({})called on every render —memoizeOneuses reference equality, but{}creates a new object each time, so memoization never worked. Every App re-render re-created gRPC clients and fired API calls..catch()onlistEnterpriseFeatures— on vanilla Kafka this returns 501. The unhandled rejection cascaded into MobX observable mutations during render, pushing React past its re-render limit.useKey('?')triggered unnecessary re-renders — the hook maintains internalpressedstate even though the callback is a no-op in production, so every?keypress forced an App re-render.Changes
app.tsx: Movesetup()into auseEffectwith empty deps and use a stable argument referencebackend-api.ts: Add.catch()handler tolistEnterpriseFeaturescalluse-developer-view.ts: Split into dev/prod implementations — production reads localStorage directly withoutuseKey, avoiding wasted re-rendersTest plan
bun run type:checkpassesbun run lintpasses (no new warnings)bun run testpasses (478/478 tests, 1 pre-existing skip)?, verify no crash?in dev mode, verify developer view toggle still works