feat(file): pair the Move File operand with a workspace file picker - #7459
feat(file): pair the Move File operand with a workspace file picker#7459icecrasher321 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR adds a basic workspace-file picker alongside the advanced Move File ID field and normalizes the selected value to one canonical file ID. It also adds focused mapper and validation tests, but the new mapper key is not populated from the retained stored field id.
Confidence Score: 4/5This PR should not merge until saved and advanced-mode Move File values are mapped from moveFileId to the key consumed by the execution mapper. The executor preserves stored parameter keys, while the changed mapper reads only moveFileInput, so existing Move File workflows carrying moveFileId fail before invoking the move operation. Files Needing Attention: apps/sim/blocks/blocks/file.ts, apps/sim/blocks/blocks/file-folders.test.ts
|
| Filename | Overview |
|---|---|
| apps/sim/blocks/blocks/file.ts | Adds the paired Move File input and normalization, but breaks persisted and advanced-mode moveFileId values by reading only moveFileInput during execution. |
| apps/sim/blocks/blocks/file-folders.test.ts | Adds useful shape and validation coverage, but bypasses persisted member-key serialization by passing moveFileInput directly. |
Reviews (1): Last reviewed commit: "feat(file): pair the Move File operand w..." | Re-trigger Greptile
| const moveInput = params.moveFileInput | ||
| if (!moveInput) { | ||
| throw new Error('File is required for move') |
There was a problem hiding this comment.
When a Move File value is stored under the retained moveFileId field, input resolution preserves that key but this mapper reads only moveFileInput, causing saved and advanced-mode workflows to throw “File is required for move” instead of moving the file.
Knowledge Base Used: Workflow authoring and rendering
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
- In
apps/sim/blocks/blocks/file.ts,moveFileInputsilently moves only the first string ID when given a mixed array of IDs and file objects, so multi-file moves can be incomplete without an error; update the parser to reject mixed entries or count and process all normalized files.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/blocks/blocks/file.ts">
<violation number="1" location="apps/sim/blocks/blocks/file.ts:2074">
P2: When `moveFileInput` contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| * A file object without one is refused with the remedy rather than | ||
| * forwarded as a shape the contract rejects. | ||
| */ | ||
| const fileIds = parseReadFileIds(moveInput) |
There was a problem hiding this comment.
P2: When moveFileInput contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/blocks/blocks/file.ts, line 2074:
<comment>When `moveFileInput` contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.</comment>
<file context>
@@ -2045,8 +2060,35 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
+ * A file object without one is refused with the remedy rather than
+ * forwarded as a shape the contract rejects.
+ */
+ const fileIds = parseReadFileIds(moveInput)
+ if (Array.isArray(fileIds)) {
+ throw new Error('Move File accepts a single file at a time')
</file context>
Summary
Type of Change
Testing
type-check(apps/sim),lint,check:audits,check-block-registry, anddocs-manifest:checkpassChecklist
🤖 Generated with Claude Code