Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error reporting on speech synthesis failures #2144

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

digitalcora
Copy link
Contributor

@digitalcora digitalcora commented Aug 19, 2024

Over the weekend, we hit a "maximum text length exceeded" error when trying to synthesize audio for a pre-fare (Sentry). Unfortunately we don't know exactly what the text was, because A) the code to log the error itself contained an error, and B) even if it had worked, we weren't logging the input text. Also, we probably wouldn't know it had happened at all, since this report would have only gone to the logs and not to Sentry.

This fixes the string interpolation in the logging, adds some needed context, and adds a Sentry report so we'll be notified when this happens again.

The current audio readout for this pre-fare is indeed rather close to the limit of 3,000 "billed characters" (exclusive of characters in SSML tags). I'll create a task for us to look into splitting up our speech somehow or cutting down on the number of characters.


In the error case, this attempt at logging the error would instead crash
because something like `{:http_error, ...}` can't be directly
interpolated into a string. This fixes the logging, adds some context,
and adds a Sentry report so we'll be notified when this happens again
on a real screen.
@digitalcora digitalcora marked this pull request as ready for review August 19, 2024 16:00
@digitalcora digitalcora requested a review from a team as a code owner August 19, 2024 16:00
Copy link
Contributor

@cmaddox5 cmaddox5 left a comment

Choose a reason for hiding this comment

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

Wow, that is close. Is the whitespace working against us here? I wonder if a quick win is to trim all strings in the views? Not something to do here, though.

@digitalcora
Copy link
Contributor Author

I'm not seeing anything that indicates whitespace wouldn't be counted (it is "spoken", after all, though multiple spaces are not spoken any differently from a single one). So that could be something, though it would only save a couple dozen characters.

@digitalcora digitalcora merged commit e18150e into main Aug 19, 2024
13 checks passed
@digitalcora digitalcora deleted the cfg-fix-error-report branch August 19, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants