Live video on the AT Protocol

Stream page crashes with null facet features #2

open
opened by timtinkers.online edited

Bug description#

I am encountering the issue on my own stream page at https://stream.place/timtinkers.online. The site briefly loads, but then the component crashes with the following TypeError:

Uncaught TypeError: can't access property "length", v is null
    segmentize facet.ts:98
    p chat-message.tsx:89
    React 8
    E scheduler.production.js:144
facet.ts:98:21

Root cause#

In the Developer tools debugger, I added a conditional breakpoint on facet.ts:98 for features === null. When the breakpoint is triggered, I see the following scopes:

Block
​
byteEnd: 8
​
byteStart: 0
​
facet: {…}
​
features: null
For
Function Body
segmentize
​
facets: (1) […]
​
text: "#hashtag"
Module
Window: Global

This is a chat message I had sent back in May, the record in my PDS shows "features": []. The record is here: https://pdsls.dev/at://did:plc:o6xucog6fghiyrvp7pyqxcs3/place.stream.chat.message/3lpjvgsbar22h

Presumably, I could delete the record and move on, but I thought I'd leave it up for now; it is unfortunate, that several months old chat messages can effectively crash my stream page.

Quite frankly I don't understand where and how features turns from an empty array into null, but seemingly the RichTextMessage for this specific message has null features when segmentize() is called.

How to reproduce#

Open my stream page at https://stream.place/timtinkers.online, tested in Chrome and Firefox.

Cheers

Just coming back to this to reiterate why I think this is worth bringing up instead of me just deleting the faulty record and moving on:

If I take the record posted above and recreate it in someone else's chat (by just changing the streamer field), I could effectively take down their stream page.

I created a 2 min video demonstrating this on an alt-account of mine: https://youtu.be/0ofdMKL_C9k

sign up or login to add to the discussion
Labels

None yet.

Participants 1
AT URI
at://did:plc:o6xucog6fghiyrvp7pyqxcs3/sh.tangled.repo.issue/3lzlb25hi2p22