-
Notifications
You must be signed in to change notification settings - Fork 1
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
[MM-59866] Prevent failure if track context has no samples #29
Conversation
@@ -181,7 +189,7 @@ func (t *Transcriber) processLiveTrack(track trackRemote, sessionID string) { | |||
} | |||
|
|||
var gap uint64 | |||
if ctx.startTS == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this since, in theory, startTS
could be still 0 even after setting it the first time if we are very unlucky and the start time was set just now. Very unlikely but you never know :)
dir, err := os.MkdirTemp("", "data") | ||
if err != nil { | ||
require.NoError(t, err) | ||
} | ||
os.Setenv("DATA_DIR", dir) | ||
t.Cleanup(func() { | ||
os.Unsetenv("DATA_DIR") | ||
os.RemoveAll(dir) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed both to simplify local testing and also to fix an existing test that was passing purely because of a failure creating the OGG file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What an unlikely bug, nice find.
Summary
An interesting case happened during our last developers meeting. If a participant is unmuted when this job starts but mutes right before the matching recording job begins, there could be a situation where the OGG file for the (now muted) track is created but no audio packet is ever written to it. This would cause decoding to fail during the post-call process and the whole job to exit.
PR adds a check to detect if the context is empty (no samples) and avoids sending it. We also make the post-processing side a little more forgiving and just ignore empty audio.
Ticket Link
https://mattermost.atlassian.net/browse/MM-59866