TranscriptBlock: TypeError in updateLines/getLineBoundaries when a chunk has no layout boxes (empty getClientRects)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start in src/components/CallView/shared/TranscriptBlock.vue at updateLines() and getLineBoundaries(), especially the accesses around lines 292 and 304. Check how the component handles empty getClientRects() results, then exercise transcript updates with an empty or unlaid-out chunk. Done when those cases no longer throw and normal transcript line-boundary behavior remains intact.
Written by the indexing model from the issue text.
Description
Steps to reproduce
- Join a call in a conversation where live transcription is active, so the live transcript panel is rendered and transcript events keep arriving.
- Have a transcript chunk whose
<span>has no client rectangles — e.g. an empty / whitespace-onlymessage, or the component not being laid out when a transcript arrives. - Keep speaking so
handleTranscriptfires (partial/final updates).
Actual
Uncaught (in promise) TypeError in the browser console:
TranscriptBlock.vue:292 const lastKnownChunkIndex = this.lines.at(-1)!.lastChunkIndex
→ can't access property "lastChunkIndex", this.lines.at(...) is undefined
Stack:
TranscriptBlock.vue:292 (updateLines → getLineBoundaries)
LiveTranscriptionRenderer.vue:302 (scrollToNextLine)
LiveTranscriptionRenderer.vue:276 (scrollToBottomLineByLine)
LiveTranscriptionRenderer.vue:261 (handleTranscript)
CallParticipantModel.js:438 (_handleTranscript) ← signaling
Cause
TranscriptBlock.updateLines() builds this.lines from this.$refs.chunks[0].getClientRects().length:
this.removeLastChunkFromLines() // may empty this.lines
if (!this.lines.length) {
const firstChunkClientRectsLength = this.$refs.chunks[0].getClientRects().length
for (let i = 0; i < firstChunkClientRectsLength; i++) {
this.lines.push({ firstChunkIndex: 0, lastChunkIndex: 0 })
}
}
const lastKnownChunkIndex = this.lines.at(-1)!.lastChunkIndex // :292
When the chunk has no client rectangles, firstChunkClientRectsLength === 0, nothing is pushed, and this.lines stays empty — then :292 dereferences this.lines.at(-1)!. There is no guard for an empty this.lines. A chunk with zero rects later in the list hits a similar unguarded nextChunkElementClientRects[0].top at :304.
Expected
updateLines() / getLineBoundaries() should not throw when this.lines is empty or a chunk has no client rects — it should just skip.
Suggested fix
const lastLine = this.lines.at(-1)
if (!lastLine) {
return
}
const lastKnownChunkIndex = lastLine.lastChunkIndex
and a length guard before nextChunkElementClientRects[0].top (~line 304).
Environment
Nextcloud 34.0.4, Talk (spreed) 24.0.5. The same code is present on master (src/components/CallView/shared/TranscriptBlock.vue:280/292).
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 598
- Avg merge
- 21h 19m
- Merged PRs (30d)
- 370
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/spreed
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug feature: chat 💬 feature: frontend 🖌️ papercut regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nextcloud/spreed#20013 · 1 comment ·
Maintainers usually reply within 1 day
-
bug feature: api 🛠️ feature: frontend 🖌️ feature: upload & shares & voice 📤🎙️ Needs triage regression
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nextcloud/spreed#19913 · 3 comments ·
Maintainers usually reply within 1 day
-
bug feature: frontend 🖌️ feature: settings ⚙️
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextcloud/spreed#19533 · 1 comment ·
Maintainers usually reply within 1 day
-
bug feature: conversations 👥 feature: frontend 🖌️ feature: search 🔎 good first issue papercut
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nextcloud/spreed#19498 · 2 comments ·
Maintainers usually reply within 1 day
All issues in nextcloud/spreed
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
danilogiles/enki-browser#113 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
evcc-io/evcc#35605 · 1 comment ·
Maintainers usually reply within 1 day
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
weavefox/awesome-opc#29 ·
Maintainers usually reply within 1 day