fix(files): normalize encoded embedded ids - #7035
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
The file content source now emits decoded Reviewed by Cursor Bugbot for commit 57701b2. Configure here. |
Greptile SummaryThe PR centralizes normalization of document-spelled embedded file IDs and applies it consistently when rendering, authorizing public-share images, exporting files, and validating Copilot-written content.
Confidence Score: 5/5The PR appears safe to merge with encoded embedded-ID handling aligned across all affected paths. The shared helper decodes document spellings exactly once, malformed values remain unchanged, canonical IDs satisfy route and storage contracts, and export rewriting continues to use the original spelling.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/uploads/utils/embedded-image-ref.ts | Adds a pure single-decode helper with fail-closed handling for malformed and double-encoded IDs. |
| apps/sim/hooks/use-file-content-source.tsx | Canonicalizes document-spelled file IDs before constructing schema-valid workspace and public inline queries. |
| apps/sim/app/api/files/public/[token]/inline/route.ts | Compares canonical embedded IDs while retaining workspace-scoped resolution and the referenced-by-document authorization gate. |
| apps/sim/app/api/files/export/[id]/route.ts | Uses canonical IDs for metadata lookup while preserving raw document spellings as rewrite keys. |
| apps/sim/lib/copilot/tools/server/files/embedded-image-refs.ts | Aligns Copilot reference validation with the same canonical ID handling used by rendering and export. |
Reviews (1): Last reviewed commit: "fix(files): normalize encoded embedded i..." | Re-trigger Greptile
Summary
Type of Change
Testing
bun run lintbun run lint:checkbun run check:auditsbun run apps/sim/scripts/check-block-registry.ts origin/stagingChecklist