Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts cause Playground Communication: Cannot read properties of undefined (reading 'trim') #2477

Open
mgeisler opened this issue Nov 28, 2024 · 4 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mgeisler
Copy link
Collaborator

If a Playground program times out (typically due to an infinite loop), we see a strange error message:

Playground Communication: Cannot read properties of undefined (reading 'trim')

We should see if we can handle this better.

@mgeisler
Copy link
Collaborator Author

@Alx-Lai, would you be interested in trying to improve this?

@mgeisler mgeisler added bug Something isn't working good first issue Good for newcomers labels Nov 28, 2024
@Alx-Lai
Copy link
Collaborator

Alx-Lai commented Nov 28, 2024

Sure! I can take a look tomorrow

@Alx-Lai
Copy link
Collaborator

Alx-Lai commented Nov 28, 2024

The behavior in 1. https://play.rust-lang.org/ vs 2. comprehensive-rust with following program.

fn main() {
    loop {}
}
  1. https://play.rust-lang.org/
    There's a textbox showing over runtime.
    Image

  2. comprehensive-rust

Playground Communication: Cannot read properties of undefined (reading 'trim')

@Alx-Lai Alx-Lai self-assigned this Nov 29, 2024
@mgeisler
Copy link
Collaborator Author

mgeisler commented Dec 6, 2024

Hey @Alx-Lai, thanks for testing this so nicely!

I've noticed that the official Playground uses a WebSocket based system now — and the endpoint we use is a simpler one-shot approach. I would like to see us migrate to the WebSocket eventually, but for now, I think we should just wrap the code in a bit of error handling to avoid showing the ugly Cannot read properties of undefined (reading 'trim') message.

Alx-Lai added a commit to Alx-Lai/comprehensive-rust that referenced this issue Dec 14, 2024
It used to have a ugly error message shows that "Playground
Communication: Cannot read properties of undefined (reading 'trim')",
which is due to the fact that the response lacks stdout attr.

Issue: google#2477
Signed-off-by: Alx-Lai <[email protected]>
djmitche pushed a commit that referenced this issue Dec 16, 2024
It used to have a ugly error message shows that "Playground
Communication: Cannot read properties of undefined (reading 'trim')",
which is due to the fact that the response lacks stdout attr.

Issue: #2477

Signed-off-by: Alx-Lai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants