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

Add timestamps to TranscriptionSegment #459

Merged
merged 4 commits into from
Aug 12, 2024
Merged

Conversation

bcherry
Copy link
Contributor

@bcherry bcherry commented Aug 9, 2024

This adds tracking of transcription receipt times which simplifies the consumption of this feature. I also removed startTime and endTime from the version we expose, since neither is used yet at the protocol level.

The new fields are firstReceivedTime and lastReceivedTime.

I tried this out in my sample project and it really simplified things. Now I can implement a very basic real-time chat thread without needing multiple data structures or new types. The only thing that still requires extra bookkeeping is tracking participant name, etc, since TranscriptionSegment lives under TrackPublication and Participant, and we don't denormalize the Participant id down the chain.

See the associated commit in my docs PR for a visual of how this simplifies basic uses

@bcherry bcherry requested review from hiroshihorie and lukasIO August 9, 2024 21:09
TranscriptionSegment(id: segment.id,
text: segment.text,
language: segment.language,
firstReceivedTime: _state.transcriptionReceivedTimes[segment.id] ?? Date(),
Copy link
Contributor

Choose a reason for hiding this comment

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

are you expecting both startTime and firstReceivedTime to have separate purposes?
Otherwise we could simply override startTime with firstReceivedTime?

Copy link
Contributor Author

@bcherry bcherry Aug 12, 2024

Choose a reason for hiding this comment

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

I don't know what startTime and endTime are intended for but I assumed they'd be in a track-local timekeeping system? They don't have a Date type - it's UInt64. When we do eventually add support for them from the server, would that cause a breaking change if we'd overloaded them already in the clients?

@bcherry bcherry merged commit b55889c into main Aug 12, 2024
9 of 11 checks passed
@bcherry bcherry deleted the bcherry/transcription-times branch August 12, 2024 21:08
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.

3 participants