[PR #4315] [MERGED] fix: sidebar codegen crashing and AWS Signature Auth flow updates #4748

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4315
Author: @AndrewBastin
Created: 9/1/2024
Status: Merged
Merged: 9/1/2024
Merged by: @AndrewBastin

Base: patchHead: fix/codegen-crash


📝 Commits (6)

  • d4a6e4a fix: sidebar codegen crashing
  • ee65f3f chore: resolve type errors
  • 9cbd59a chore: add default values for AWS Signature auth type fields
  • 5f42475 chore: no response message added
  • 2dda654 Merge branch 'fix/codegen-crash' of github.com:AndrewBastin/hoppscotch into pr/AndrewBastin/4315
  • ad9ce4c chore: revert updates to HttpRequest component

📊 Changes

7 files changed (+63 additions, -26 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+2 -1)
📝 packages/hoppscotch-common/src/components/graphql/Authorization.vue (+4 -0)
📝 packages/hoppscotch-common/src/components/http/Authorization.vue (+5 -0)
📝 packages/hoppscotch-common/src/components/http/Codegen.vue (+13 -3)
📝 packages/hoppscotch-common/src/components/http/ResponseInterface.vue (+15 -2)
📝 packages/hoppscotch-common/src/helpers/RequestRunner.ts (+2 -2)
📝 packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts (+22 -18)

📄 Description

Closes #4314

This PR includes fixes for the following issues:-

  • Codegen Sidebar crashes upon opening and shows up as blank.
  • Choosing AWS Signature as the Authorization type without populating the relevant fields and attempting to send a request results in an exception. Saving the request to a collection in this state and attempting to run it via the CLI will lead to the same error since they are required fields.

What's changed

  • getEffectiveRESTRequest returns a Promise, this was not awaited in the computation for the code generation, leading to a null reference, crashing the sidebar. The correction was to await the promise and evaluate based on that. This has been extended to all places of usage.
  • Assign default values (empty string) corresponding to the fields while choosing AWS Signature as the Authorization type.
  • Resolve type errors.

Notes to reviewers

N/A


🔄 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/4315 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 9/1/2024 **Status:** ✅ Merged **Merged:** 9/1/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `patch` ← **Head:** `fix/codegen-crash` --- ### 📝 Commits (6) - [`d4a6e4a`](https://github.com/hoppscotch/hoppscotch/commit/d4a6e4a5a1f3e8eaf074db49c87b37c1d835ccf4) fix: sidebar codegen crashing - [`ee65f3f`](https://github.com/hoppscotch/hoppscotch/commit/ee65f3ff74d86abd50e6a06ec5739661bcead602) chore: resolve type errors - [`9cbd59a`](https://github.com/hoppscotch/hoppscotch/commit/9cbd59a41401e7637b2d77df76b7d21bd7757b2c) chore: add default values for AWS Signature auth type fields - [`5f42475`](https://github.com/hoppscotch/hoppscotch/commit/5f424750be09dde37b5ead3f8abcc1e25bd32b73) chore: no response message added - [`2dda654`](https://github.com/hoppscotch/hoppscotch/commit/2dda654f4eeb99a5a14fea1c22d1f58146978c65) Merge branch 'fix/codegen-crash' of github.com:AndrewBastin/hoppscotch into pr/AndrewBastin/4315 - [`ad9ce4c`](https://github.com/hoppscotch/hoppscotch/commit/ad9ce4c5b31c07d4e791f6bb8da3e153a2966718) chore: revert updates to `HttpRequest` component ### 📊 Changes **7 files changed** (+63 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+2 -1) 📝 `packages/hoppscotch-common/src/components/graphql/Authorization.vue` (+4 -0) 📝 `packages/hoppscotch-common/src/components/http/Authorization.vue` (+5 -0) 📝 `packages/hoppscotch-common/src/components/http/Codegen.vue` (+13 -3) 📝 `packages/hoppscotch-common/src/components/http/ResponseInterface.vue` (+15 -2) 📝 `packages/hoppscotch-common/src/helpers/RequestRunner.ts` (+2 -2) 📝 `packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts` (+22 -18) </details> ### 📄 Description Closes #4314 This PR includes fixes for the following issues:- - Codegen Sidebar crashes upon opening and shows up as blank. - Choosing AWS Signature as the Authorization type without populating the relevant fields and attempting to send a request results in an exception. Saving the request to a collection in this state and attempting to run it via the CLI will lead to the same error since they are required fields. ### What's changed - `getEffectiveRESTRequest` returns a Promise, this was not awaited in the computation for the code generation, leading to a null reference, crashing the sidebar. The correction was to await the promise and evaluate based on that. This has been extended to all places of usage. - Assign default values (empty string) corresponding to the fields while choosing `AWS Signature` as the Authorization type. - Resolve type errors. ### Notes to reviewers N/A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:15:23 +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#4748
No description provided.