diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java index 5f62d3371745..738f4a14a223 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java @@ -53,7 +53,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.Gson; import io.micrometer.observation.ObservationRegistry; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.ArrayUtils; @@ -771,6 +770,25 @@ protected Function> executionExce }; } + /** + * This function deep copies the actionConfiguration object to send the original object to mixpanel which contains + * the actual user query with bindings + * @param actionConfiguration + * @return + */ + private ActionConfiguration deepCopyActionConfiguration(ActionConfiguration actionConfiguration) { + try { + // Convert the ActionConfiguration object to JSON string + String json = objectMapper.writeValueAsString(actionConfiguration); + + // Convert the JSON string back to an ActionConfiguration object + return objectMapper.readValue(json, ActionConfiguration.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return null; + } + /** * Handles the execution logic, call to pluginExecutor with the payload post retrieval and validation of action, datasource, and plugin * @@ -799,9 +817,7 @@ protected Mono getActionExecutionResult( ActionConfiguration rawActionConfiguration = null; if (actionDTO != null && actionDTO.getActionConfiguration() != null) { // deep copying the actionConfiguration to avoid any changes in the original object - Gson gson = commonConfig.gsonInstance(); - rawActionConfiguration = gson.fromJson( - gson.toJson(actionDTO.getActionConfiguration()), ActionConfiguration.class); + rawActionConfiguration = this.deepCopyActionConfiguration(actionDTO.getActionConfiguration()); } log.debug(