{"record":{"id":"d2ed51a52d5498e9","repo":"qishibo/AnotherRedisDesktopManager","slug":"pickle-is-readonly-now","errorCode":null,"errorMessage":"Pickle is readonly now!","messagePattern":"Pickle is readonly now!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/viewers/ViewerPickle.vue","lineNumber":23,"sourceCode":"<script type=\"text/javascript\">\nimport JsonEditor from '@/components/JsonEditor';\nimport { Parser } from 'pickleparser';\n\nexport default {\n  props: ['content'],\n  components: { JsonEditor },\n  computed: {\n    newContent() {\n      try {\n        return (new Parser()).parse(this.content);\n      } catch (e) {\n        return 'Pickle parsed failed!';\n      }\n    },\n  },\n  methods: {\n    getContent() {\n      this.$message.error('Pickle is readonly now!');\n      return false;\n    },\n    copyContent() {\n      return this.$refs.editor.getRawContent();\n    },\n  },\n};\n</script>\n","sourceCodeStart":5,"sourceCodeEnd":32,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/viewers/ViewerPickle.vue#L5-L32","documentation":"Element UI toast deliberately returned by the Python pickle viewer's getContent() — the viewer is read-only by design. Python pickle payloads are arbitrary bytecode-driven object graphs; unserializing then re-serializing user edits safely is not feasible, so the component blocks the write path: getContent() always toasts 'Pickle is readonly now!' and returns false, which tells the parent viewer to abort the save. copyContent() still allows copying raw bytes.","triggerScenarios":"Opening a key whose value the app identified as Python pickle (via pickletools-style detection), editing the decoded view, and clicking save/apply — getContent() unconditionally rejects; any attempt to write through this viewer hits the same wall, there is no code path that succeeds.","commonSituations":"Users of Python services (Django/celery sessions, scylla/redis-py caches) expecting to edit pickle values in place like JSON; double-clicking a value then pressing Ctrl+S in the editor.","solutions":["Treat the pickle view as read-only — edit the value in your Python application instead","If the value is actually JSON or msgpack, switch the viewer mode manually to a writable viewer before editing","Delete and re-SET the key through the app/console with the new pickled bytes produced by Python","If write support is required, the app cannot safely re-pickle arbitrary edits; keep the readonly contract"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// viewer contract: getContent() === false means 'not writable'\nconst canWrite = viewer.getContent !== ViewerPickle.prototype.getContent;","typeGuard":"const isWritableViewer = (viewer) => typeof viewer.getContent === 'function' && viewer.isReadOnly !== true;","tryCatchPattern":null,"preventionTips":["Hide the save button for read-only viewers instead of relying on the toast","Encode edits on the producer side (Python pickle.dumps) and SET bytes via console","If values need in-app editing, store JSON instead of pickle"],"tags":["python-pickle","readonly-viewer","vue","redis-viewer"],"backgroundTag":"readonly-format-viewer","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}