|
50 | 50 | use Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
|
51 | 51 | use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException;
|
52 | 52 | use Symfony\Component\PropertyAccess\PropertyAccess;
|
| 53 | +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; |
| 54 | +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; |
53 | 55 | use Symfony\Component\Serializer\SerializerInterface;
|
54 | 56 | use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
55 | 57 | use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
|
@@ -107,7 +109,7 @@ public function __construct(
|
107 | 109 | protected readonly EventLogService $eventLog,
|
108 | 110 | protected readonly SubmissionService $submissionService,
|
109 | 111 | protected readonly ScoreboardService $scoreboardService,
|
110 |
| - protected readonly SerializerInterface $serializer, |
| 112 | + protected readonly SerializerInterface&DenormalizerInterface&NormalizerInterface $serializer, |
111 | 113 | #[Autowire('%domjudge.version%')]
|
112 | 114 | string $domjudgeVersion
|
113 | 115 | ) {
|
@@ -1886,7 +1888,8 @@ protected function addPendingEvent(string $type, string|int $id, Event $event, C
|
1886 | 1888 | objectId: $id,
|
1887 | 1889 | data: [$data],
|
1888 | 1890 | );
|
1889 |
| - $dependencies[$type . '-' . $id] = ['type' => $type, 'id' => $id, 'event' => $event]; |
| 1891 | + $normalizedEvent = $this->serializer->normalize($event, Event::class, ['api_version' => $this->getApiVersion()]); |
| 1892 | + $dependencies[$type . '-' . $id] = ['type' => $type, 'id' => $id, 'event' => $normalizedEvent]; |
1890 | 1893 | $this->addOrUpdateWarning($event, $data->id, ExternalSourceWarning::TYPE_DEPENDENCY_MISSING, [
|
1891 | 1894 | 'dependencies' => $dependencies,
|
1892 | 1895 | ]);
|
@@ -1917,7 +1920,7 @@ protected function loadPendingEvents(): void
|
1917 | 1920 |
|
1918 | 1921 | $type = $dependency['type'];
|
1919 | 1922 | $id = $dependency['id'];
|
1920 |
| - $event = $dependency['event']; |
| 1923 | + $event = $this->serializer->denormalize($dependency['event'], Event::class, 'json', ['api_version' => $this->getApiVersion()]); |
1921 | 1924 |
|
1922 | 1925 | if (!isset($this->pendingEvents[$type][$id])) {
|
1923 | 1926 | $this->pendingEvents[$type][$id] = [];
|
|
0 commit comments