v0.7.2: logs export security, code hygiene, mship cost attribution#4956
Conversation
* fix(security): neutralize CSV formula injection in logs export * refactor(csv): extract neutralizeCsvFormula to shared util * fix(csv): only neutralize string cells in logs export
…ogs dashboard (#4950) * refactor(ui): eliminate prop drilling in editor, home, sidebar, and logs dashboard - panel editor: activeSearchTarget was relayed untouched through SubBlock and 30+ input components (depth up to 6); now provided once via ActiveSearchTargetProvider and re-provided at tool-input's synthetic sub-block transformation points; removed the vestigial workspaceId option from SubBlockInputController/useSubBlockInput - home: ChatSurfaceProvider carries chatId/userId and stable interaction callbacks to UserInput/MessageContent/MessageActions; MothershipResourcesProvider carries the five resource operations to ResourceTabs, removing MothershipView's pure-relay props - sidebar: extended SidebarDragContext into SidebarListContext so WorkflowItem/FolderItem read selection/drag callbacks directly; moved the hidden import input up to sidebar.tsx (also fixes import no-op while the list shows a skeleton) - logs dashboard: DashboardSegmentsContext feeds StatusBar directly; WorkflowsList no longer relays segment selection state * refactor(home): sync ChatSurfaceProvider callback refs in a layout effect Mutating refs during render is unsound under concurrent rendering (render may run multiple times before commit); useLayoutEffect commits the latest callbacks before any user event can fire.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview CSV exports for logs and tables route string cells through shared UI refactors replace deep prop drilling with React context: ChatSurface ( Reviewed by Cursor Bugbot for commit 1a5cf49. Configure here. |
Greptile SummaryThis PR bundles three fixes: CSV formula injection neutralization for the logs export endpoint, removal of prop drilling across editor/home/sidebar/logs-dashboard via new context providers, and best-effort workspace-ID attribution for self-hosted and headless billing clients.
Confidence Score: 3/5Safe to merge on the UI refactor and CSV fix; the billing attribution route has a gap where a transient workspace lookup failure propagates and fails the whole cost update. The billing route comment promises that costs will never be dropped over attribution metadata, but the workspace DB lookup is not guarded by try-catch. A transient Postgres error during that lookup causes the entire updateCostInner to throw, the caller gets a 500, and the cost ends up in a retry/dead-letter queue rather than being recorded unattributed as intended. The UI prop-drilling refactor and CSV injection fix are mechanically correct and low-risk. apps/sim/app/api/billing/update-cost/route.ts — the resolveAttributableWorkspaceId function needs exception handling to honour its best-effort contract. Important Files Changed
Sequence DiagramsequenceDiagram
participant Go as Go Mothership
participant Route as POST /api/billing/update-cost
participant Resolver as resolveAttributableWorkspaceId
participant DB as Postgres (workspace table)
participant Ledger as recordUsage / recordCumulativeUsage
Go->>Route: "{userId, cost, workspaceId?, idempotencyKey?}"
Route->>Resolver: workspaceId (may be undefined)
alt workspaceId is undefined (headless client)
Resolver-->>Route: undefined
else workspaceId provided
Resolver->>DB: "SELECT id FROM workspace WHERE id = workspaceId LIMIT 1"
alt row found
DB-->>Resolver: "{id}"
Resolver-->>Route: workspaceId
else not found (self-hosted foreign ID)
DB-->>Resolver: []
Resolver-->>Route: undefined (logs warning)
else DB error (not handled)
DB-->>Resolver: throws
Resolver-->>Route: throws — gap
end
end
Route->>Ledger: record cost with attributedWorkspaceId
Ledger-->>Route: ok
Route-->>Go: 200
|
Uh oh!
There was an error while loading. Please reload this page.