{"record":{"id":"f3e2091772d93034","repo":"qishibo/AnotherRedisDesktopManager","slug":"size-too-large-show-only-the-first-this-firstch","errorCode":null,"errorMessage":"Size too large, show only the first ${this.firstChars} characters and you cannot edit it.","messagePattern":"Size too large, show only the first (.+?) characters and you cannot edit it\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/viewers/ViewerOverSize.vue","lineNumber":26,"sourceCode":"    <el-input :disabled='true' type='textarea' :value='contentDisplay'></el-input>\n  </div>\n</template>\n\n<script type=\"text/javascript\">\nexport default {\n  data() {\n    return {\n      firstChars: 20000,\n    };\n  },\n  props: ['content', 'contentVisible', 'disabled'],\n  computed: {\n    contentDisplay() {\n      return `${this.$util.bufToString(this.content.slice(0, this.firstChars), false)\n      }...Show only the first ${this.firstChars} characters, the rest has been hidden...`;\n    },\n    alertTitle() {\n      return `Size too large, show only the first ${this.firstChars} characters and you cannot edit it.`;\n    },\n  },\n};\n</script>\n\n<style type=\"text/css\">\n  .size-too-large-viewer .el-alert {\n    margin: 3px 0 8px 0;\n    color: #f56c6c;\n    background-color: #f9dbdb;\n  }\n\n  /*text viewer box*/\n  .key-content-string .size-too-large-viewer .el-textarea textarea {\n    height: calc(100vh - 290px);\n  }\n</style>\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/viewers/ViewerOverSize.vue#L8-L44","documentation":"Alert title of ViewerOverSize, the fallback viewer that FormatViewer renders when Buffer.byteLength(content) exceeds its over-size threshold (FormatViewer.vue:118). Instead of loading a multi-megabyte value into the normal editor (which freezes the UI), the app slices the content to the first 20000 characters (contentDisplay) and shows this read-only notice. It is a deliberate degradation path, not an exception.","triggerScenarios":"Opening any key whose serialized content exceeds FormatViewer.overSizeBytes: FormatViewer.viewersMap routes 'OverSize' -> ViewerOverSize, contentDisplay() renders content.slice(0, 20000) via bufToString, and alertTitle shows this message with editing disabled.","commonSituations":"Large cached HTML/JSON blobs, session payloads, serialized objects, or big list members opened in the GUI; users confused why the viewer is read-only and the text ends with '...Show only the first 20000 characters...'.","solutions":["Read or edit the value through the CLI tab (GET key / SET key ...), which has no size limit","Raise firstChars in ViewerOverSize.vue data() together with FormatViewer.overSizeBytes if your machine renders larger strings smoothly","Copy/dump the value out (copy-to-clipboard) and edit it in an external editor, then SET it back","Split the oversized value into smaller keys at the application level"],"exampleFix":"// before (ViewerOverSize.vue)\ndata() {\n  return { firstChars: 20000 };\n},\n\n// after - raise the cap, and raise FormatViewer.overSizeBytes to match,\n// otherwise FormatViewer keeps swapping in the OverSize viewer\n// before firstChars is ever consulted\ndata() {\n  return { firstChars: 100000 };\n},","handlingStrategy":"validation","validationCode":"// Check size before choosing a viewer, mirroring FormatViewer.overSize\nconst MAX_INLINE_BYTES = 2 * 1024 * 1024; // align with FormatViewer.overSizeBytes\n\nfunction isRenderableInline(content) {\n  return Buffer.isBuffer(content) && Buffer.byteLength(content) <= MAX_INLINE_BYTES;\n}\n\nif (!isRenderableInline(content)) {\n  openExternalViewer(content); // CLI / file dump instead of the inline editor\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Know the threshold is checked in bytes (Buffer.byteLength), not characters - multi-byte UTF-8 hits it sooner","Keep large values out of the GUI path; use the CLI tab for big GET/SET","If you raise firstChars, raise FormatViewer.overSizeBytes too or the swap never happens"],"tags":["vue","redis-gui","ardm","truncation","read-only","performance"],"backgroundTag":"payload-too-large","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}