Skip to content

A live screen that ends tells the app, and the app renders it in the branch it is not in #287

Description

@beardthelion

The server tells a viewer when its live screen ends. The app takes that message, stores it, and then
renders it only in the branch it is not in.

LiveScreen forwards every {type: "error"} frame to onProblem
(app/src/components/computer/live-screen.tsx:79-80), and ComputerView sets that into problem
(computer-view.tsx:224, :646). The only thing that draws problem is NothingToSee
(:153-158), and the two are alternatives of the same ternary at :642:

) : showLiveScreen ? (
  <LiveScreen ... onProblem={setProblem} />
) : (
  <NothingToSee ... problem={problem} />
)

So while the live screen is mounted, which is exactly when a person is watching, the message lands in
state that nothing on screen is reading. showLiveScreen is !settled && (showScreen || driving)
(:432), so it stays true while somebody is driving, which is when they are most likely to be told
something.

What a person sees instead is the last frame that arrived, indefinitely. The canvas is not cleared,
so a screen that has ended looks exactly like a screen where nothing is happening. Their input goes
nowhere and they are not told why.

Three cases reach this today, and there is a fourth once #190 is fixed:

  • Another window took the screen. A second /stream replaces the first, and the replaced socket is
    told rather than closed, because it belongs to a client that may still be using it.
  • The socket could not be reached at all (live-screen.tsx:120).
  • The screen could not be started (the open handler's failure path).
  • After The live screen is tracked per Bot rather than per socket, and four failures follow from it #190: the computer stopped, was reset, or its browser was closed by the cap or the idle
    sweep. Each of those now sends the watching socket a message saying so.

I have a branch for the #190 half, which is all server-side and leaves this untouched. Worth saying
plainly that the server work does not fix what a person sees: the message arrives at the socket and
stops there.

Not a security or data problem. It is somebody watching a still image and not knowing the screen is
over.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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