MongoDB: cap Binary blob size and label FLE/sensitive subtypes (6/7)
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 3h 8m
- Merged PRs (30d)
- 6
Description
Follow-up from PR #129 review (https://github.com/appspace/helix/pull/129#pullrequestreview-4211833511).
## Problem
Today `serializeBinary` in `server/src/drivers/mongodb.ts` base64-encodes the entire buffer, regardless of size. Two concrete hazards:
1. **Size bloat.** A document with a multi-MB GridFS chunk reference, an embedded image, or a subtype-6 ciphertext blob will base64-encode in full and ship over the wire to the grid, where ResultsGrid word-wraps it into a single cell. Easily 10x JSON bloat plus a frozen browser.
2. **Opaque FLE/sensitive subtypes.** Subtype 6 (client-side field-level encryption) and subtype 7 (sensitive) currently render as plain `Binary(6,)`. A user staring at ciphertext won't necessarily realize what they're looking at.
## Proposed shape
- Cap base64 payload at e.g. 1 KB (constant, easy to tune). Beyond the cap, truncate with a length annotation:
`Binary(,..., bytes)`
- Special-case subtypes 6 and 7 with a label that drops the ciphertext entirely:
`Encrypted( bytes)`
## Out of scope
Whether to expose a "show full payload" affordance on a row click — that's a UI question for a separate ticket if anyone asks for it.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.