Skip to content

Event handling bug + live streaming inside iframe #86

@zk1tty

Description

@zk1tty

Issue

  1. At anime-watch-hub sample, iframe sandbox was not allowed to render the browser live stream, which requires run JavaScript.
  2. return value data type was old and function didn't work now.
    https://v0-animefinder.vercel.app/
Image

The fix

Before

Image

After

Image
  1. sandbox attirbute
  • remove sandbox="allow-same-origin" attribute.
  • added allow-scripts and allow-forms to the sandbox attribute. The live viewer from TinyFish needs JavaScript to render the browser stream.
  1. amend /run-see streaming API endpoint event handling types

    Before (wrong) After (correct)
    data.streamingUrl data.streaming_url on STREAMING_URL event
    data.type === 'STATUS', data.message data.type === 'PROGRESS', data.purpose
    data.type === 'COMPLETE', data.resultJson data.type === 'COMPLETE', data.result + data.status
    No failure handling data.status === 'failed' → error state with data.error.message

Comment

I only tried this folder, but I assume same issues can happen at other folders tool.
Highly recommended to review and adjust to new event types on /run-sse endpoints.
doc: https://docs.tinyfish.ai/key-concepts/endpoints#streaming-/run-sse

cc: @simantak-dabhade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions