From 4a43807f34725444de70daddbe74696bb14b7413 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sat, 4 Dec 2021 19:47:57 +0530 Subject: [PATCH] fix: formdata inconsistencies --- packages/hoppscotch-app/helpers/network.ts | 4 +++- packages/hoppscotch-app/newstore/history.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-app/helpers/network.ts b/packages/hoppscotch-app/helpers/network.ts index add0106f1..59f84d932 100644 --- a/packages/hoppscotch-app/helpers/network.ts +++ b/packages/hoppscotch-app/helpers/network.ts @@ -1,5 +1,6 @@ import { AxiosRequestConfig } from "axios" import { BehaviorSubject, Observable } from "rxjs" +import cloneDeep from "lodash/cloneDeep" import AxiosStrategy, { cancelRunningAxiosRequest, } from "./strategies/AxiosStrategy" @@ -49,8 +50,9 @@ export const sendNetworkRequest = (req: any) => runAppropriateStrategy(req).finally(() => window.$nuxt.$loading.finish()) export function createRESTNetworkRequestStream( - req: EffectiveHoppRESTRequest + request: EffectiveHoppRESTRequest ): Observable { + const req = cloneDeep(request) const response = new BehaviorSubject({ type: "loading", req, diff --git a/packages/hoppscotch-app/newstore/history.ts b/packages/hoppscotch-app/newstore/history.ts index 9d09edfff..340823f28 100644 --- a/packages/hoppscotch-app/newstore/history.ts +++ b/packages/hoppscotch-app/newstore/history.ts @@ -287,7 +287,12 @@ export function toggleGraphqlHistoryEntryStar(entry: GQLHistoryEntry) { // Listen to completed responses to add to history completedRESTResponse$.subscribe((res) => { if (res !== null) { - if (res.type === "loading" || res.type === "network_fail") return + if ( + res.type === "loading" || + res.type === "network_fail" || + res.type === "script_fail" + ) + return addRESTHistoryEntry( makeRESTHistoryEntry({