Skip to content

feat(cad): onshape syncs show each step and how many api calls are left - #220

Merged
AadiJo merged 1 commit into
mainfrom
onshape-import-status-updates
Nov 8, 2026
Merged

AadiJo merged 1 commit into
mainfrom
onshape-import-status-updates

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Onshape syncs gave no feedback beyond "Syncing…", even though each API request already reports where the import is. The app also had no idea how much of the account's yearly Onshape API limit a sync used.

Now an Onshape sync opens one toast that follows the import step by step: checking for changes, reading the model, Onshape's export with elapsed time, the download, building part geometry (N of M), and saving. When the sync ends, the same toast becomes the result and shows how many of the connection's yearly API calls remain.

  • Each connection counts the calls Onshape bills (2xx and 3xx responses, counted when the response arrives, so a failed download still counts) and resets the count each calendar year.
  • The yearly limit defaults to 2,500 (Free, Standard, and EDU Student plans). It can be changed with the new "API limit" button on the connection card, which also shows this year's usage.
  • The calls a single sync used appear only with the new Appearance setting "Show Onshape API calls per sync".
  • Live progress lives in server memory and streams over a new cad.progress.watch subscription. The call count and usage are saved on the sync's outcome.

Onshape exposes no usage API, so the count covers only calls made by cadsense. Other apps on the same account are not included.

onshape-sync-progress.mp4
Sync toast at each step, then the finished and up-to-date results Connection card with this year's API usage and the API limit button

Proof: apps/server/scripts/onshape-cad-sync-e2e.ts (extended here) synced a real Onshape assembly through the app. Server traces showed 13 Onshape requests, and the app counted 13. The toast's remaining count matched the saved usage after both a cold and an unchanged sync. A new transport test covers a billed response whose download then fails.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cadsense Ready Ready Preview Nov 8, 2026 8:32pm UTC

@AadiJo
AadiJo merged commit 8193155 into main Nov 8, 2026
8 checks passed
@AadiJo
AadiJo deleted the onshape-import-status-updates branch November 26, 2026 19:51

This branch was successfully deployed

1 active deployment
Preview — 5f60e239 Deployed Nov 8, 2026 by vercel[bot]
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