[PR #4562] [MERGED] fix: show file chip for the selected file in binary body #4853

Closed
opened 2026-03-17 02:21:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4562
Author: @amk-dev
Created: 11/26/2024
Status: Merged
Merged: 11/27/2024
Merged by: @jamesgeorge007

Base: nextHead: feat/binary-body-bug-fixs


📝 Commits (5)

  • b84be11 chore: show selected file name as a chip
  • 6f6395b chore: fix nested migrations by updating verzod
  • b59b97a chore: fix a broken test
  • a594836 fix: account for nested versioned entity migrations
  • f68b8dc fix: add safeguards for interceptor inspector

📊 Changes

11 files changed (+781 additions, -68 deletions)

View changed files

📝 packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts (+704 -2)
📝 packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts (+2 -32)
📝 packages/hoppscotch-cli/src/options/test/env.ts (+22 -2)
📝 packages/hoppscotch-cli/src/utils/workspace-access.ts (+16 -2)
📝 packages/hoppscotch-common/package.json (+1 -1)
📝 packages/hoppscotch-common/src/components/http/BodyBinary.vue (+6 -2)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/interceptors.inspector.ts (+4 -0)
📝 packages/hoppscotch-common/src/services/persistence/__tests__/__mocks__/index.ts (+17 -8)
📝 packages/hoppscotch-data/package.json (+1 -1)
📝 packages/hoppscotch-selfhost-desktop/package.json (+1 -1)
📝 pnpm-lock.yaml (+7 -17)

📄 Description

Before

  • Choose File input looses context about the selected file when switching tabs, input[type="file"] doesnt support a file as its value when repopulating.
  • If we export a binary body request and import it again, when opening that request, we were getting a dirty status for the request
    • this was because when exporting, File objects get serialized to an empty object.
    • our dirty check was comparing a null against an empty object {}, this check failed and the request was put into dirty status
    • but this shouldnt have been an issue if our migrations where working properly.
    • but there was an issue with nested schemas in verzod.
    • this was fixed in the package ( in 0.2.3 ) via AndrewBastin/verzod#1, but our packages were still using the old ( 0.2.2 ) version

After

  • We use the Filechip component to show the selected file name. ( same behaviour as multipart/formdata )
  • updated verzod to 0.2.3 on all our packages

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4562 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 11/26/2024 **Status:** ✅ Merged **Merged:** 11/27/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/binary-body-bug-fixs` --- ### 📝 Commits (5) - [`b84be11`](https://github.com/hoppscotch/hoppscotch/commit/b84be110dce918cf9377783909caf373a335682d) chore: show selected file name as a chip - [`6f6395b`](https://github.com/hoppscotch/hoppscotch/commit/6f6395bc352b23b8fa3bfd95457268a59a5cd148) chore: fix nested migrations by updating verzod - [`b59b97a`](https://github.com/hoppscotch/hoppscotch/commit/b59b97a1c401335422bc87af2c2ad800456dec49) chore: fix a broken test - [`a594836`](https://github.com/hoppscotch/hoppscotch/commit/a5948360a03468fc61593f9e1f933a64c90b9365) fix: account for nested versioned entity migrations - [`f68b8dc`](https://github.com/hoppscotch/hoppscotch/commit/f68b8dc59ed21087412a3a65fa9e5da96526d5d5) fix: add safeguards for interceptor inspector ### 📊 Changes **11 files changed** (+781 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts` (+704 -2) 📝 `packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts` (+2 -32) 📝 `packages/hoppscotch-cli/src/options/test/env.ts` (+22 -2) 📝 `packages/hoppscotch-cli/src/utils/workspace-access.ts` (+16 -2) 📝 `packages/hoppscotch-common/package.json` (+1 -1) 📝 `packages/hoppscotch-common/src/components/http/BodyBinary.vue` (+6 -2) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/interceptors.inspector.ts` (+4 -0) 📝 `packages/hoppscotch-common/src/services/persistence/__tests__/__mocks__/index.ts` (+17 -8) 📝 `packages/hoppscotch-data/package.json` (+1 -1) 📝 `packages/hoppscotch-selfhost-desktop/package.json` (+1 -1) 📝 `pnpm-lock.yaml` (+7 -17) </details> ### 📄 Description **Before** - Choose File input looses context about the selected file when switching tabs, input[type="file"] doesnt support a file as its value when repopulating. - If we export a binary body request and import it again, when opening that request, we were getting a dirty status for the request - this was because when exporting, File objects get serialized to an empty object. - our dirty check was comparing a `null` against an empty object `{}`, this check failed and the request was put into dirty status - but this shouldnt have been an issue if our migrations where working properly. - but there was an issue with nested schemas in verzod. - this was fixed in the package ( in 0.2.3 ) via AndrewBastin/verzod#1, but our packages were still using the old ( 0.2.2 ) version **After** - We use the Filechip component to show the selected file name. ( same behaviour as multipart/formdata ) - updated `verzod` to `0.2.3` on all our packages --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:21:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4853
No description provided.