feat: shortened and filename-safe request ids

This commit is contained in:
Björn Fromme
2026-03-16 12:03:00 +01:00
parent 1cc7a025a1
commit 33609ab534
6 changed files with 70 additions and 4 deletions
+3 -1
View File
@@ -22,6 +22,7 @@ use App\BusProNet\Model\Travel;
use App\BusProNet\XmlParser\ApiResponseParser;
use App\Form\Model\BookingDto;
use App\Form\Model\RegistrationDto;
use App\Service\RequestIdGenerator;
use League\Flysystem\FilesystemException;
use League\Flysystem\FilesystemOperator;
use Psr\Log\LoggerInterface;
@@ -58,6 +59,7 @@ class ApiClient
private readonly LoggerInterface $logger,
private readonly BookingDataProcessor $bookingDataProcessor,
private readonly RequestStack $requestStack,
private readonly RequestIdGenerator $requestIdGenerator,
array $options,
) {
$this->config = $this->resolveOptions($options);
@@ -762,7 +764,7 @@ class ApiClient
private function getRequestId(): string
{
$baseId = $this->requestStack->getMainRequest()?->attributes->get('request_id')
?? date(DATE_ATOM);
?? $this->requestIdGenerator->generateBaseId();
return $baseId.'_'.++$this->requestCounter;
}