-
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I found already merged PR #275. But it's still not working.
I'm getting 500 response and error in logs:
TypeError: fwrite(): Argument #2 ($data) must be of type string, false given in /app/vendor/nyholm/psr7/src/Stream.php at line 228
I guess this is because returned array is JSON encoded before sending response, and depth parameter is not specified here:
$response->getBody()->write(\json_encode($payload));This happens only on first FlameChart request, before it's cached in filesystem. After that, I'm getting another error:
Modules\Profiler\Interfaces\Queries\FindFlameChartByUuidHandler::__invoke(): Return value must be of type array|string, null returned
The depth parameter is also not specified in this line:
server/app/modules/Profiler/Interfaces/Queries/FindFlameChartByUuidHandler.php
Lines 26 to 28 in 0a6773f
| if ($this->bucket->exists($file)) { | |
| return \json_decode($this->bucket->getContents($file), true); | |
| } |
Solution that worked in my case: return JSON string directly instead of array:
if ($this->bucket->exists($file)) {
- return \json_decode($this->bucket->getContents($file), true);
+ return $this->bucket->getContents($file);
}- $this->bucket->write($file, \json_encode($waterfall, 0, 5000));
+ $response = \json_encode($waterfall, 0, 5000);
+ $this->bucket->write($file, $response);
- return $waterfall;
+ return $response;
}Metadata
Metadata
Assignees
Labels
No labels