Skip to content

fix(api): Pass archivedAt to list table response - #4275

Merged
TheodoreSpeaks merged 10 commits into
stagingfrom
fix/table-archived-at
Apr 23, 2026
Merged

fix(api): Pass archivedAt to list table response#4275
TheodoreSpeaks merged 10 commits into
stagingfrom
fix/table-archived-at

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

We skipped passing archivedAt for the list tables endpoint, causing the ui for recently deleted to fallback on updated time. Fixed this by passing archivedAt. Audited other resources which don't have this issue.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Manual review

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)

Screenshots/Videos

@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedApr 23, 2026 4:57pm

Request Review

@cursor

cursorBot commented Apr 23, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk: adds an extra field to the GET /api/table list response and normalizes its serialization, without changing access control or persistence logic.

Overview
Fixes the GET /api/table list endpoint to include each table’s archivedAt timestamp in the JSON response.

The handler now serializes archivedAt to an ISO string when it’s a Date, otherwise coerces to string when present, and returns null when not archived.

Reviewed by Cursor Bugbot for commit fe7e462. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a missing archivedAt field in the GET /api/table list endpoint response. Without it, the UI for "recently deleted" tables fell back to updatedAt when determining the archive timestamp. The fix follows the same nullable-date serialization pattern already used by other endpoints in the codebase.

Confidence Score: 5/5

Safe to merge — single-line bug fix with no logic risk.

The change is minimal and correct: it adds a nullable date field with the same three-branch guard (instanceof Date → ISO string, truthy non-Date → String(), falsy → null) that is consistent with nullable date handling elsewhere. No P0/P1 issues found.

No files require special attention.

Important Files Changed

FilenameOverview
apps/sim/app/api/table/route.tsAdds archivedAt to the GET /api/table list response, correctly handling Date, non-null non-Date, and null cases.

Sequence Diagram

sequenceDiagram
participant UI as UI (Recently Deleted)
participant API as GET /api/table
participant DB as Database
UI->>API: GET /api/table?scope=archived
API->>DB: listTables(workspaceId, { scope })
DB-->>API: tables[] (including archivedAt)
Note over API: Before fix: archivedAt omitted from response
Note over API: After fix: archivedAt serialized and included
API-->>UI: { tables: [{ ..., archivedAt: "2026-04-20T..." }] }
UI->>UI: Display correct archive timestamp
Loading

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile

@TheodoreSpeaks
TheodoreSpeaks merged commit b86ebb3 into stagingApr 23, 2026
14 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/table-archived-at branch April 24, 2026 16:40
Sign up for freeto 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

@TheodoreSpeaks