diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py
index 4005bde9..7c57151a 100644
--- a/backend/app_sdk/app_base.py
+++ b/backend/app_sdk/app_base.py
@@ -371,7 +371,7 @@ class AppBase:
# FIXME: Adding retries here.
try:
finished = False
- for i in range (0, 5):
+ for i in range (0, 10):
try:
ret = requests.post(url, headers=headers, json=action_result, timeout=10)
@@ -384,22 +384,32 @@ class AppBase:
except requests.exceptions.RequestException as e:
self.logger.info(f"[DEBUG] Request problem: {e}")
+ time.sleep(0.1)
+
#time.sleep(5)
continue
except TimeoutError as e:
self.logger.info(f"[DEBUG] Timeout or request: {e}")
+ time.sleep(0.1)
+
#time.sleep(5)
continue
except requests.exceptions.ConnectionError as e:
self.logger.info(f"[DEBUG] Connectionerror: {e}")
+ time.sleep(0.1)
+
#time.sleep(5)
continue
except http.client.RemoteDisconnected as e:
self.logger.info(f"[DEBUG] Remote: {e}")
+ time.sleep(0.1)
+
#time.sleep(5)
continue
except urllib3.exceptions.ProtocolError as e:
self.logger.info(f"[DEBUG] Protocol err: {e}")
+ time.sleep(0.1)
+
#time.sleep(5)
continue
@@ -408,8 +418,8 @@ class AppBase:
if not finished:
# Not sure why this would work tho :)
action_result["status"] = "FAILURE"
- action_result["result"] = json.dumps({"success": False, "reason": "POST error: Failed connecting to %s over 5 retries" % url})
- self.logger.info(f"[DEBUG] Before typeerror stream result - NOT finished after 5 requests")
+ action_result["result"] = json.dumps({"success": False, "reason": "POST error: Failed connecting to %s over 10 retries to the backend" % url})
+ self.logger.info(f"[DEBUG] Before typeerror stream result - NOT finished after 10 requests")
ret = requests.post("%s%s" % (self.base_url, stream_path), headers=headers, json=action_result)
self.logger.info(f"""[DEBUG] Successful request result request: Status= {ret.status_code} & Response= {ret.text}. Action status: {action_result["status"]}""")
diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx
index 712e7624..fbe6b94e 100644
--- a/frontend/src/components/ParsedAction.jsx
+++ b/frontend/src/components/ParsedAction.jsx
@@ -1410,7 +1410,7 @@ const ParsedAction = (props) => {
if (currentItem.description === openApiFieldDesc) {
currentItem.field_active = !hideBody;
- console.log("Changing", currentItem);
+ //console.log("Changing", currentItem);
}
}
}}
diff --git a/frontend/src/components/ShuffleCodeEditor.jsx b/frontend/src/components/ShuffleCodeEditor.jsx
index 09feeaad..20aaca45 100644
--- a/frontend/src/components/ShuffleCodeEditor.jsx
+++ b/frontend/src/components/ShuffleCodeEditor.jsx
@@ -16,7 +16,7 @@ import {
import Checkbox from '@mui/material/Checkbox';
import { orange } from '@mui/material/colors';
import { isMobile } from "react-device-detect"
-import { GetParsedPaths } from "../views/Apps.jsx";
+import { GetParsedPaths, FindJsonPath } from "../views/Apps.jsx";
import NestedMenuItem from "material-ui-nested-menu-item";
import {
@@ -345,9 +345,9 @@ const CodeEditor = (props) => {
//console.log(found)
// Whelp this is inefficient af. Single loop pls
- try{
- // When the found array is empty.
- for (var i = 0; i < found.length; i++) {
+ // When the found array is empty.
+ for (var i = 0; i < found.length; i++) {
+ try {
found[i] = found[i].toLowerCase()
var valuefound = false
@@ -379,13 +379,28 @@ const CodeEditor = (props) => {
//}
try {
- input = input.replace(found[i], JSON.stringify(actionlist[k].example))
+ var new_input = FindJsonPath(fullpath, actionlist[k].example)
} catch (e) {
- input = input.replace(found[i], actionlist[k].example)
+ console.log("ERR IN INPUT: ", e)
}
+ if (typeof new_input === "object") {
+ new_input = JSON.stringify(new_input)
+ } else {
+ if (typeof new_input === "string") {
+ new_input = new_input
+ } else {
+ new_input = ""
+ }
+ }
+
+ input = input.replace(found[i], new_input)
+
+ //} catch (e) {
+ // input = input.replace(found[i], actionlist[k].example)
+ //}
+
shouldbreak = true
- console.log("New input: ", input)
break
}
}
@@ -395,9 +410,9 @@ const CodeEditor = (props) => {
}
}
}
+ } catch (e) {
+ console.log("Replace error: ", e)
}
- } catch (e) {
- console.log("Replace error: ", e)
}
const tmpValidation = validateJson(input.valueOf())
@@ -823,7 +838,6 @@ const CodeEditor = (props) => {
//