Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Commit 490ef9e

Browse files
authored
fix: exec log now properly renders return values (#1546)
## Description Fix: Session execution log return values not rendering Problem Return values in the Session Execution Log were not displaying correctly - they appeared as non-expandable items showing character counts (e.g., "180 items") instead of the actual JSON data. Root Cause 1. Parsed return values weren't wrapped in the correct DeepProtoValueResult structure, causing activity.returnValue.value to be undefined 2. JSON return values could be double-encoded (JSON string containing JSON string), causing JsonViewer to treat them as character arrays instead of objects Changes src/models/activity.model.ts:85-103 - Wrapped parsed return values in proper { type: "object", value: parsedValue } structure - Added double-parse logic to handle nested JSON strings - Added fallback to wrap plain strings in objects for proper display src/components/organisms/deployments/sessions/tabs/activities/singleActivityInfo.tsx:68-74 - Replaced ValueRenderer with JsonViewer for consistency with Arguments/KW Arguments sections - Ensured return values are expandable and display correctly Result Return values now display and expand correctly in the Session Execution Log, matching the behavior of arguments and kwargs. ## What type of PR is this? (check all applicable) - [ ] 💡 (feat) - A new feature (non-breaking change which adds functionality) - [ ] 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature - [x] 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue) - [ ] 🏎 (perf) - Optimization - [ ] 📄 (docs) - Documentation - Documentation only changes - [ ] 📄 (test) - Tests - Adding missing tests or correcting existing tests - [ ] ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) - [ ] ☑️ (chore) - Chores - Other changes that don't modify src or test files - [ ] ↩️ (revert) - Reverts - Reverts a previous commit(s). <!-- For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure you've done the following: - 👷‍♀️ Create small PRs. In most cases this will be possible. - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages (as described below). - 📗 Update any related documentation and include any relevant screenshots. Commit Message Structure (all lower-case): <type>(optional ticket number): <description> [optional body] -->
1 parent 1904610 commit 490ef9e

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎src/components/organisms/deployments/sessions/tabs/activities/singleActivityInfo.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { triggerEvent } from "@src/hooks";
77
import { SessionActivity } from "@src/interfaces/models";
88

99
import { Button } from "@components/atoms";
10-
import { JsonViewer, ValueRenderer } from "@components/molecules";
10+
import { JsonViewer } from "@components/molecules";
1111

1212
import { ArrowLeft, Close } from "@assets/image/icons";
1313

@@ -66,7 +66,12 @@ export const SingleActivityInfo = ({
6666
)}
6767

6868
<div className="mb-4 mt-8 font-bold">{t("returnValues")}</div>
69-
<ValueRenderer value={activity.returnValue?.value} />
69+
70+
{activity.returnValue?.value && Object.keys(activity.returnValue.value).length ? (
71+
<JsonViewer isCollapsed={true} value={activity.returnValue.value} />
72+
) : (
73+
<div>{t("noReturnValuesFound")}</div>
74+
)}
7075
</div>
7176
</div>
7277
</div>

‎src/models/activity.model.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,19 @@ export function convertSessionLogRecordsProtoToActivitiesModel(
8484

8585
if (callAttemptComplete.result?.value) {
8686
try {
87-
const parsedValue = safeParseSingleProtoValue(callAttemptComplete.result.value);
88-
currentActivity.returnValue =
89-
parsedValue || ({ type: "object", value: {} } as DeepProtoValueResult);
87+
let parsedValue = safeParseSingleProtoValue(callAttemptComplete.result.value);
88+
89+
if (typeof parsedValue === "string") {
90+
try {
91+
parsedValue = JSON.parse(parsedValue);
92+
} catch {
93+
parsedValue = { value: parsedValue };
94+
}
95+
}
96+
97+
currentActivity.returnValue = parsedValue
98+
? { type: "object", value: parsedValue }
99+
: { type: "object", value: {} };
90100
} catch {
91101
currentActivity.returnValue = { type: "object", value: {} } as DeepProtoValueResult;
92102
}

0 commit comments

Comments
 (0)