Skip to content

Conversation

julien-nc
Copy link
Member

@julien-nc julien-nc commented Sep 5, 2025

When checking if the last attachment is an audio one right before scheduling the task to generate a new message.

This goes well with some Php configs that are not strict. It can also crash.

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc added bug Something isn't working 3. to review labels Sep 5, 2025
$session = $this->sessionMapper->getUserSession($this->userId, $sessionId);
$lastConversationToken = $session->getAgencyConversationToken() ?? '{}';

$lastAttachments = $lastUserMessage->jsonSerialize()['attachments'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, are we sure that ['attachments'] is set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julien-nc julien-nc merged commit 4164b51 into main Sep 5, 2025
16 checks passed
@julien-nc julien-nc deleted the fix/noid/audio-attachment-check branch September 5, 2025 14:11
@julien-nc julien-nc mentioned this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants