Conversation
🤖 Augment PR SummarySummary: This PR enhances JS node test-run and mock-data capabilities and improves value/date handling. Changes:
Technical Notes: Mock-data retrieval is guarded by connector capabilities ( 🤖 Was this summary useful? React with 👍 or 👎 |
| return success(); | ||
| } | ||
|
|
||
| @GetMapping("migrate-js/mock-data") |
There was a problem hiding this comment.
manager/tm/src/main/java/com/tapdata/tm/task/controller/TaskController.java:1268: This is a GET endpoint but it uses @RequestBody, which many clients/proxies won’t send/forward for GET requests (leading to missing dto at runtime). This can make the mock-data API unreliable and hard to call consistently.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
iengine/iengine-app/src/main/java/io/tapdata/services/QueryDataBaseDataService.java
Show resolved
Hide resolved
| for (Map<String, Object> map : maps) { | ||
| codecsFilterManager.transformToTapValueMap(map, tapTable.getNameFieldMap()); | ||
| originCodecsFilterManager.transformFromTapValueMap(map); | ||
| if(limit != null){ |
There was a problem hiding this comment.
iengine/iengine-app/src/main/java/io/tapdata/services/QueryDataBaseDataService.java:176: limit != null is being used both to control the limit and to toggle stringification + the response shape (sometimes returning only sampleData). This makes the method’s output contract dependent on whether limit is provided, which can easily break callers that pass/omit limit for unrelated reasons.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| private void checkCapability(DataSourceConnectionDto connection, String capabilityId, String errorCode, String connectionId) { | ||
| boolean supported = CollectionUtils.isNotEmpty(connection.getCapabilities()) | ||
| && connection.getCapabilities().stream() | ||
| .anyMatch(capability -> capability.getId().equals(capabilityId)); |
There was a problem hiding this comment.
manager/tm/src/main/java/com/tapdata/tm/task/service/impl/TaskNodeServiceImpl.java:1015: capability.getId().equals(capabilityId) can throw an NPE if any capability has a null id. A null-safe comparison would avoid failing capability checks on partially populated capability entries.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| return value; | ||
| } | ||
| if (value instanceof String) { | ||
| return JSONUtil.toList(StringUtils.trim((String) value), Map.class); |
There was a problem hiding this comment.
iengine/iengine-app/src/main/java/io/tapdata/flow/engine/util/TestRunInputEventConvertUtil.java:232: convertArrayValue parses a JSON string using JSONUtil.toList(..., Map.class), which will fail for arrays of primitives/strings (e.g., [1,2]) or mixed element types. If test-run input JSON includes scalar arrays, this will throw during conversion.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| buildInMethod.append("var LinkedHashMap = Java.type(\"java.util.LinkedHashMap\");\n"); | ||
| buildInMethod.append("var ArrayList = Java.type(\"java.util.ArrayList\");\n"); | ||
| buildInMethod.append("var Date = Java.type(\"java.util.Date\");\n"); | ||
| buildInMethod.append("var Date = Java.type(\"io.tapdata.entity.schema.value.DateTime\");\n"); |
There was a problem hiding this comment.
iengine/iengine-common/src/main/java/com/tapdata/processor/ScriptUtil.java:343: Rebinding the built-in JS Date type from java.util.Date to io.tapdata.entity.schema.value.DateTime is a behavior-breaking change (constructors/methods differ) and can cause existing JS node scripts to fail at runtime. It may need explicit compatibility handling or clear migration guidance.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
No description provided.