Skip to content

feat(arch): unblock and add Request update use-case to the Insomnia facade - #10344

Draft
gatzjames wants to merge 1 commit into
arch-phase-2c-request-delete-use-casefrom
arch-phase-2c-request-update-use-case
Draft

feat(arch): unblock and add Request update use-case to the Insomnia facade#10344
gatzjames wants to merge 1 commit into
arch-phase-2c-request-delete-use-casefrom
arch-phase-2c-request-update-use-case

Conversation

@gatzjames

Copy link
Copy Markdown
Contributor

No description provided.

…acade

Resolves the two architectural blockers flagged for Request's update route:

- Ports getPathParametersFromUrl (previously insomnia-data's
  models.request helper) into domain/src/request/path-parameters.ts - a
  pure regex-based URL parser with no dependencies.
- Ports the UI-only ContentTypeDropdown's updateMimeType into
  domain/src/request/request-body-for-mime-type.ts as
  getRequestBodyForMimeTypeChange, including its own minimal, default-options
  port of insomnia-data's deconstructQueryStringToParams (the general
  version stays in insomnia-data/common-src/querystring.ts unchanged - it's
  used by several other UI call sites unrelated to this use-case, so only
  the specific default-args behavior needed here was ported, not moved).

With both helpers now in `domain`, application/src/request/update-request.
use-case.ts recomposes the route's original branching: recompute
pathParameters when a Request or WebSocketRequest's url changes, rewrite
body/headers when a Request's mimeType changes, otherwise apply the patch
as-is. debug.request.$requestId.update.tsx now delegates the actual merge
to RequestModule.updateById(), while keeping its own pre-fetch to preserve
two side-effect-only behaviors that don't belong in the use-case: skipping
the requestRenamed analytics event when mimeType also changed (matching the
route's prior early-return), and comparing old vs. new name for that event.

Also adds a missing "test" script to domain/package.json - domain had zero
test files before this change, so its absence was never noticed, but
without it these new domain unit tests (and any future ones) would silently
never run under `npm test`.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ Circular References Report

Generated at: 2026-08-06T12:49:55.758Z
Status: ✅ NO CHANGE

Summary

Metric Base (arch-phase-2c-request-delete-use-case) PR Change
Total Circular References 13 13 0 (0.00%)
Click to view all circular references in PR (13)
../apps/desktop/src/common/render.ts -> ../apps/desktop/src/network/network.ts
../apps/desktop/src/network/network.ts -> ../apps/desktop/src/network/concurrency.renderer.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
../packages/insomnia-scripting-environment/src/objects/collection.ts -> ../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts -> ../packages/insomnia-scripting-environment/src/objects/insomnia.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts -> ../packages/insomnia-scripting-environment/src/objects/insomnia.ts -> ../packages/insomnia-scripting-environment/src/objects/send-request.ts
desktop/src/main/prompt-bridge.ts -> desktop/src/main/window-utils.ts -> desktop/src/main/plugin-window.ts
desktop/src/main/window-utils.ts -> desktop/src/main/plugin-window.ts
desktop/src/network/network.ts -> desktop/src/common/render.ts
desktop/src/ui/components/settings/import-export.tsx -> desktop/src/ui/components/modals/export-requests-modal.tsx
desktop/src/ui/components/tabs/tab-list.tsx -> desktop/src/ui/components/tabs/tab.tsx
desktop/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> desktop/src/ui/components/templating/external-vault/external-vault-form.tsx
desktop/src/ui/components/viewers/response-viewer.tsx -> desktop/src/ui/components/viewers/response-multipart-viewer.tsx
Click to view all circular references in base branch (13)
../apps/desktop/src/common/render.ts -> ../apps/desktop/src/network/network.ts
../apps/desktop/src/network/network.ts -> ../apps/desktop/src/network/concurrency.renderer.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
../packages/insomnia-scripting-environment/src/objects/collection.ts -> ../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts -> ../packages/insomnia-scripting-environment/src/objects/insomnia.ts
../packages/insomnia-scripting-environment/src/objects/response.ts -> desktop/src/network/network.ts -> ../packages/insomnia-scripting-environment/src/objects/index.ts -> ../packages/insomnia-scripting-environment/src/objects/insomnia.ts -> ../packages/insomnia-scripting-environment/src/objects/send-request.ts
desktop/src/main/prompt-bridge.ts -> desktop/src/main/window-utils.ts -> desktop/src/main/plugin-window.ts
desktop/src/main/window-utils.ts -> desktop/src/main/plugin-window.ts
desktop/src/network/network.ts -> desktop/src/common/render.ts
desktop/src/ui/components/settings/import-export.tsx -> desktop/src/ui/components/modals/export-requests-modal.tsx
desktop/src/ui/components/tabs/tab-list.tsx -> desktop/src/ui/components/tabs/tab.tsx
desktop/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> desktop/src/ui/components/templating/external-vault/external-vault-form.tsx
desktop/src/ui/components/viewers/response-viewer.tsx -> desktop/src/ui/components/viewers/response-multipart-viewer.tsx

Analysis

No Change: This PR does not introduce or remove any circular references.


This report was generated automatically by comparing against the arch-phase-2c-request-delete-use-case branch.

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