Repository navigation
refactor(web): route device flow and marketplace template calls through contract clients - #47122
Conversation
…gh contract clients
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (88.96%) is below the adjusted base coverage (89.17%). You can increase the head coverage or adjust the Removed Code Behavior. Additional details and impacted files@@ Coverage Diff @@
## main #47122 +/- ##
==========================================
- Coverage 90.46% 89.72% -0.75%
==========================================
Files 6570 6561 -9
Lines 409923 409247 -676
Branches 82121 81938 -183
==========================================
- Hits 370855 367213 -3642
- Misses 32678 35579 +2901
- Partials 6390 6455 +65
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Vinext bundle analysisJS gzip: 🟠 +15.86 KiB (+0.15%) · CSS gzip: ⚪ No change
Entry changes: 🟠 108 increased · 🟢 1 decreased (gzip). Largest entry changesTop 5 by absolute gzip delta. Static dependencies overlap; do not sum entries.
Top 20 of 109 changed entries (full paths and raw sizes)
📦 0 package attribution changes (uncompressed modules)Showing 0 of 0, ordered by absolute module-size delta.
Measurement details and build revisionsBase: Raw JS change: 🟠 +92.61 KiB (+0.27%) · Raw CSS change: ⚪ No change 🟠 Increase · 🟢 Decrease · ⚪ Unchanged. Colors indicate direction, not a performance budget verdict. Percentages use the base size. Entries follow only static edges in the official Rolldown chunk graph, deduplicating shared files. Dynamic entries are measured when loaded; they are not page first-load metrics. Entry totals overlap and must not be summed. Download base/merge snapshots and official Rolldown analysis reports. Comparison: event base SHA vs the tested merge commit at GITHUB_SHA (PR or merge queue). |
…clients # Conflicts: # web/service/marketplace-templates.ts
Summary
Moves raw
fetchcalls that bypassed the shared clients onto contract clients, with the same user-visible behavior.web/service/device-flow.ts):lookup,approveanddenynow call the generated openapi contract (oauth.device) through anOpenAPILinkon the page origin's/openapi/v1prefix, over the sharedrequest()layer. That layer now adds the console CSRF header and refreshes an expired console session, which the old hand-rolled calls didn't do. When the session can't be refreshed,request()already leaves/devicein place, so the page still shows its own view. Calls aresilent, so the raw server code is never shown in a toast. HTTP failures are translated back intoDeviceFlowErrorwith the same mapping as before:{"error": "<code>"}from the body, or the status fallback. Network failures pass through unchanged.approval-context,approve-external): stays on plainfetch.approve-externalauthenticates with the per-flow token inX-CSRF-Token. The shared layer fills that same header from the console CSRF cookie, so it would overwrite or merge the token. These routes also have no console session to refresh, and they aren't in the generated contract.web/service/marketplace-templates.ts): adds atemplateDslroute (GET /templates/{templateId}/dsl) topackages/contracts/marketplace.tsand calls it throughmarketplaceClient. The marketplace serves the DSL as a YAML attachment, which the OpenAPI client decodes to aFile, so the result is read with.text()./device.Out of scope: the agent skill file content fetch in
use-skill-detail.ts. It follows a URL the server issues (built withurl_forand query arguments the server picks) and reads it as a blob. The matching consolefiles/contentcontracts for agent and app routes don't declare those query parameters.Checklist
vp staged(frontend) to appease the lint gods