diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 473d2e1f..b270e8f3 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -727,7 +727,7 @@ class AppBase: parsedvalue = json.loads(allvalues["value"]) allvalues["value"] = parsedvalue except: - print("Parsing of value as JSON failed") + print("Parsing of value as JSON failed. Continue anyway!") return allvalues except: @@ -1377,7 +1377,10 @@ class AppBase: cachedata = self.get_cache(actual_key) print("CACHE: %s" % cachedata) parsersplit.pop(1) - baseresult = cachedata + try: + baseresult = json.dumps(cachedata) + except json.decoder.JSONDecodeError as e: + print("Failed json dumping: %s" % e) #returndata = str(baseresult)+str(appendresult) else: diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 37f79b0c..71816cf6 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -2106,7 +2106,11 @@ func executeCloudAction(action shuffle.CloudSyncJob, apikey string) error { return err } - client := &http.Client{} + transport := http.DefaultTransport.(*http.Transport).Clone() + client := &http.Client{ + Transport: transport, + } + syncUrl := fmt.Sprintf("%s/api/v1/cloud/sync/handle_action", syncUrl) req, err := http.NewRequest( "POST", @@ -3828,6 +3832,22 @@ func remoteOrgJobHandler(org shuffle.Org, interval int) error { return nil } +func runInitCloudSetup() { + action := shuffle.CloudSyncJob{ + Type: "setup", + Action: "init", + OrgId: "", + PrimaryItemId: "", + } + + err := executeCloudAction(action, "") + if err != nil { + log.Printf("[INFO] Failed initial setup: %s", err) + } else { + log.Printf("[INFO] Ran initial setup!") + } +} + func runInitEs(ctx context.Context) { log.Printf("[DEBUG] Starting INIT setup (ES)") @@ -3842,7 +3862,8 @@ func runInitEs(ctx context.Context) { return } - log.Printf("Error getting organizations: %s", err) + log.Printf("[DEBUG] Error getting organizations: %s", err) + runInitCloudSetup() } else { // Add all users to it if len(activeOrgs) == 1 { @@ -3850,7 +3871,9 @@ func runInitEs(ctx context.Context) { } if len(activeOrgs) == 0 { - log.Printf(`No orgs. Setting NEW org "default"`) + log.Printf(`[DEBUG] No orgs. Setting NEW org "default"`) + runInitCloudSetup() + //orgSetupName := "default" //orgId := uuid.NewV4().String() //newOrg := shuffle.Org{ diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 0e629790..f32040fb 100644 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -154,7 +154,7 @@ const Admin = (props) => { // Need to wait because query in ES is too fast setTimeout(() => { getAppAuthentication() - }, 500) + }, 1000) alert.success("Successfully deleted authentication!") } }), @@ -228,7 +228,7 @@ const Admin = (props) => { .then((responseJson) => { setTimeout(() => { handleGetOrg(org_id) - }, 500) + }, 1000) }) .catch(error => { alert.error("Err: " + error.toString()) @@ -356,7 +356,7 @@ const Admin = (props) => { setSelectedUserModalOpen(false) setTimeout(() => { getAppAuthentication() - }, 500) + }, 1000) } }), ) @@ -514,7 +514,7 @@ const Admin = (props) => { setModalOpen(false) setTimeout(() => { getUsers() - }, 500) + }, 1000) } }), ) @@ -549,7 +549,7 @@ const Admin = (props) => { setModalOpen(false) setTimeout(() => { getUsers() - }, 500) + }, 1000) } }), ) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index a51195a7..1c10af83 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -308,7 +308,7 @@ const AngularWorkflow = (props) => { } if (param.name === "startnode" && outersub.id !== undefined) { - console.log("SHOULD SET STARTNODE: ", outersub) + console.log("SHOULD SET STARTNODE IN SUBFLOW SELECTION: ", outersub) const innernode = outersub.actions.find(action => action.id === param.value) console.log("FOUND NODE: ", innernode) if (innernode !== undefined && subworkflowStartnode.id !== innernode.id) { diff --git a/frontend/src/views/Workflows.jsx b/frontend/src/views/Workflows.jsx index d75ff690..d3497e4b 100644 --- a/frontend/src/views/Workflows.jsx +++ b/frontend/src/views/Workflows.jsx @@ -531,7 +531,7 @@ const Workflows = (props) => { deleteWorkflow(selectedWorkflowId) setTimeout(() => { getAvailableWorkflows() - }, 500) + }, 1000) } setDeleteModalOpen(false) }} color="primary"> @@ -1491,7 +1491,7 @@ const Workflows = (props) => { // Update :) setTimeout(() => { getAvailableWorkflows() - }, 500) + }, 1000) setImportLoading(false) } else { alert.info("Successfully changed basic info for workflow")