You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Event handling bug + live streaming inside iframe #86
The iframe issue is a straightforward sandbox policy misconfiguration — allow-same-origin alone restricts script execution, which breaks any JavaScript-dependent renderer like TinyFish's live stream viewer. The /run-sse event handling mismatch points to the client code being written against an older version of the API contract; the field renames (streamingUrl → streaming_url, STATUS → PROGRESS, resultJson → result) and the addition of a failed status suggest the SSE payload schema was updated server-side without corresponding client updates in the sample. As the reporter notes, any other samples using /run-sse likely share the same stale event handler pattern and should be audited against the current schema documented at https://docs.tinyfish.ai/key-concepts/endpoints#streaming-/run-sse.
I ran the repo-wide review @zk1tty recommended here. The prediction held — three recipes still have the same defect shape (a consumer waiting on an event type or field that no producer emits):
tinyskills — hooks/use-generation.ts:202 handles source_streaming, but app/api/scrape-sources/route.ts never emits it. Live preview never renders. (Featured recipe with a live demo.)
stay-scout-hub — src/lib/api/area-search.ts:84 handles event.type === 'STATUS', but api/research-area/route.ts emits only CONNECTED, SCREENSHOT, COMPLETE, ERROR. Progress text never updates. This one survived the SDK migration in Migration stay-scout-hub to Tinyfish SDK #223: the route was updated to EventType.STREAMING_URL / event.streaming_url, the client handler wasn't.
competitor-analysis — app/api/scrape-pricing/route.ts:369 reads event.streamingUrl off the raw SDK event; the SDK emits streaming_url, so the guard never fires and the preview is dead end-to-end.
anime-watch-hub (the folder in this issue) is fine now — #164 fixed it — which is why this stayed quiet.
The two dead-branch cases are statically detectable: the set of event types a client compares against should be a subset of the types its recipe emits. I've opened #243 proposing a small conformance check for exactly that, plus the SDK snake_case boundary, so this class of bug stops reaching main instead of being re-found by hand each time.
Taking these three fixes unless someone's already on them — will send one small PR per recipe so they're independently reviewable.
Fixes are up, one PR per recipe so they can be reviewed and reverted independently:
Remove dead live-preview path from tinyskills #245 — tinyskills: removes the dead source_streaming path. Worth a look at the reasoning: this recipe moved to Fetch, which has no browser session, so there is no streaming URL to surface. Making the "Watch live" link work again would mean moving back to the metered Agent endpoint, which is a product call rather than a bug fix — so this removes the vestigial path instead of inventing an event.
Fix stay-scout-hub progress text never updating #246 — stay-scout-hub: the route was dropping PROGRESS, the event that carries the narration. It now forwards it as the STATUS the client already expects, and the client also handles CONNECTED so the opening message lands.
Fix competitor-analysis live browser preview never appearing #247 — competitor-analysis: drops the any cast and reads the stream through the SDK's EventType/RunStatus. Also fixes two stale reads that were masked by fallbacks ('STEP', resultJson), and moves error handling into the COMPLETE branch since there is no ERROR event type.
Each verified with tsc --noEmit (and npm run lint where the recipe's lint config still works — stay-scout-hub has eslint@^9 with no eslint.config.js, so its lint script is broken on main independently of this).
Once these land, every recipe in the repo is clean against the check in #244. Since @zk1tty's original folder (anime-watch-hub) was fixed in #164, this issue can close with #245–#247 — happy to leave it open if you'd rather track the check separately.
Activity
[-]Unlock live streaming inside iframe[/-][+]Event handling bug + live streaming inside iframe[/+]Fix anime-watch-hub (#87)
Fix anime-watch-hub (tinyfish-io#87)
JiwaniZakir commentedon Mar 31, 2026
The iframe issue is a straightforward sandbox policy misconfiguration —
allow-same-originalone restricts script execution, which breaks any JavaScript-dependent renderer like TinyFish's live stream viewer. The/run-sseevent handling mismatch points to the client code being written against an older version of the API contract; the field renames (streamingUrl→streaming_url,STATUS→PROGRESS,resultJson→result) and the addition of afailedstatus suggest the SSE payload schema was updated server-side without corresponding client updates in the sample. As the reporter notes, any other samples using/run-sselikely share the same stale event handler pattern and should be audited against the current schema documented athttps://docs.tinyfish.ai/key-concepts/endpoints#streaming-/run-sse.Hotragn commentedon Aug 4, 2026
I ran the repo-wide review @zk1tty recommended here. The prediction held — three recipes still have the same defect shape (a consumer waiting on an event type or field that no producer emits):
tinyskills—hooks/use-generation.ts:202handlessource_streaming, butapp/api/scrape-sources/route.tsnever emits it. Live preview never renders. (Featured recipe with a live demo.)stay-scout-hub—src/lib/api/area-search.ts:84handlesevent.type === 'STATUS', butapi/research-area/route.tsemits onlyCONNECTED,SCREENSHOT,COMPLETE,ERROR. Progress text never updates. This one survived the SDK migration in Migration stay-scout-hub to Tinyfish SDK #223: the route was updated toEventType.STREAMING_URL/event.streaming_url, the client handler wasn't.competitor-analysis—app/api/scrape-pricing/route.ts:369readsevent.streamingUrloff the raw SDK event; the SDK emitsstreaming_url, so the guard never fires and the preview is dead end-to-end.anime-watch-hub(the folder in this issue) is fine now — #164 fixed it — which is why this stayed quiet.The two dead-branch cases are statically detectable: the set of event types a client compares against should be a subset of the types its recipe emits. I've opened #243 proposing a small conformance check for exactly that, plus the SDK snake_case boundary, so this class of bug stops reaching
maininstead of being re-found by hand each time.Taking these three fixes unless someone's already on them — will send one small PR per recipe so they're independently reviewable.
Hotragn commentedon Aug 4, 2026
Fixes are up, one PR per recipe so they can be reviewed and reverted independently:
tinyskills: removes the deadsource_streamingpath. Worth a look at the reasoning: this recipe moved to Fetch, which has no browser session, so there is no streaming URL to surface. Making the "Watch live" link work again would mean moving back to the metered Agent endpoint, which is a product call rather than a bug fix — so this removes the vestigial path instead of inventing an event.stay-scout-hub: the route was droppingPROGRESS, the event that carries the narration. It now forwards it as theSTATUSthe client already expects, and the client also handlesCONNECTEDso the opening message lands.competitor-analysis: drops theanycast and reads the stream through the SDK'sEventType/RunStatus. Also fixes two stale reads that were masked by fallbacks ('STEP',resultJson), and moves error handling into theCOMPLETEbranch since there is noERRORevent type.Each verified with
tsc --noEmit(andnpm run lintwhere the recipe's lint config still works —stay-scout-hubhaseslint@^9with noeslint.config.js, so its lint script is broken onmainindependently of this).Once these land, every recipe in the repo is clean against the check in #244. Since @zk1tty's original folder (
anime-watch-hub) was fixed in #164, this issue can close with #245–#247 — happy to leave it open if you'd rather track the check separately.zk1tty commentedon Aug 4, 2026
Hi @Hotragn thank you for picking up these!
I guess @simantak-dabhade is the person in charge of PR.