Skip to content

Commit d2ad6ba

Browse files
committed
Fix breadcrumb accumulation across requests in Swoole environment
- Clear view params between requests to prevent breadcrumbs from accumulating - View component is shared across requests in Swoole, so params must be reset manually - Fixes issue where breadcrumbs show repeated items from previous requests
1 parent 44aa31b commit d2ad6ba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Server/RequestDispatcher.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,18 @@ public function dispatch(Request $request, Response $response, SwooleCoroutineHt
127127
}
128128
}
129129

130+
// Clear view params (breadcrumbs, etc.)
131+
if ($app->has('view')) {
132+
try {
133+
$view = $app->get('view', false);
134+
if ($view && is_object($view) && property_exists($view, 'params')) {
135+
$view->params = [];
136+
}
137+
} catch (\Throwable $e) {
138+
// Ignore errors
139+
}
140+
}
141+
130142
// Clear response data and reset format
131143
$yiiResponse->data = null;
132144
$yiiResponse->content = null;

0 commit comments

Comments
 (0)