Skip to content

fix(mothership): fix build error#3717

Merged
Sg312 merged 1 commit intostagingfrom
fix/mothership-patch-build
Mar 23, 2026
Merged

fix(mothership): fix build error#3717
Sg312 merged 1 commit intostagingfrom
fix/mothership-patch-build

Conversation

@Sg312
Copy link
Collaborator

@Sg312 Sg312 commented Mar 23, 2026

Summary

Fix build

Type of Change

  • Bug fix

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 23, 2026 6:15pm

Request Review

@Sg312 Sg312 changed the title Fix build fix(mothership): fix build error Mar 23, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR fixes a TypeScript build error in PptxPreview where dataUpdatedAt was already referenced in the useEffect dependency array (line 631) but was never destructured from the useWorkspaceFileBinary hook. The one-line fix properly destructures the field, resolving the compiler error.

Key changes:

  • Destructures dataUpdatedAt from useWorkspaceFileBinary in PptxPreview so the useEffect dependency array reference is valid.

Behavioral note: Beyond fixing the build, this change also ensures correctness at runtime — dataUpdatedAt (a React Query timestamp that updates on every refetch) guarantees the PPTX render effect re-triggers whenever the file binary is refreshed, even if fileData happens to share the same reference or byteLength as the prior fetch.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted fix with no functional regressions.
  • Single-line change that correctly destructures a standard React Query field (dataUpdatedAt) already referenced in the dependency array. The hook (useWorkspaceFileBinary wrapping useQuery) always returns this field, so the destructuring is always valid. No logic paths are altered beyond ensuring the effect dependency is properly declared.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/file-viewer.tsx Adds missing dataUpdatedAt destructuring from useWorkspaceFileBinary, fixing a TypeScript build error where the variable was referenced in the useEffect dependency array but never declared.

Sequence Diagram

sequenceDiagram
    participant RQ as React Query
    participant Hook as useWorkspaceFileBinary
    participant Comp as PptxPreview
    participant Effect as useEffect (render slides)

    RQ->>Hook: refetch (on window focus / cache invalidation)
    Hook-->>Comp: { fileData, dataUpdatedAt, ... }
    Note over Comp: dataUpdatedAt changes on every refetch
    Comp->>Effect: dependency [fileData, dataUpdatedAt, ...] changed
    Effect->>Effect: re-render PPTX slides
Loading

Reviews (1): Last reviewed commit: "Fix build" | Re-trigger Greptile

@Sg312 Sg312 merged commit 8294d8c into staging Mar 23, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/mothership-patch-build branch March 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant