UI::HtmlDialog fetch request randomly hangs

Hi,

My team and some of our clients have observed an issue where fetch requests will randomly hang when using UI::HtmlDialog in Sketchup 2024.0.533 on Windows 11 and also reproduced in 2024.0.544 on MacOS 14.5.

We do not see the issue outside of Sketchup 2024 - including testing in Chrome, Sketchup 2023 and Sketchup 2022.

I have raised this issue on the GitHub Issue Tracker as well where you can find more details and troubleshooting: UI::HtmlDialog fetch request randomly hangs · Issue #991 · SketchUp/api-issue-tracker · GitHub

Steps to reproduce with code snippets

The following are the steps I used to reproduce the issue reliably - it does use an infinite loop to make fetch requests, this is not required to reproduce the issue but due to its random nature this is the easiest way to guarantee the issue occurs.

  • Launch a server on localhost (express code given below, note that any local server will work really)
// example node.js express server (though any will work)
const express = require('express')

const app = express();

app.get('/', (_request, response) => {
  response.send('test')
})

app.listen(3000, () => {
  console.log('Listening on port 3000')
})
  • Run the following HtmlDialog code in the Sketchup 2024 Ruby Console
# HTML Dialog
dialog = UI::HtmlDialog.new()
dialog.set_html(%{
  <!DOCTYPE html>
  <html lang="en">
    <body>
      <button onclick="loopRequests()">Begin</button>
    </body>
    <script>
      const loopRequests = async () => {
        while (true) {
          const res = await fetch("http://localhost:3000")
          const text = await res.text();
        }
      };
    </script>
  </html>
})
dialog.show
  • Open the chrome dev tools and go to network tab
  • click the “Begin” button in the HtmlDialog to begin the requests loop
  • note that eventually in the network tab the requests stop and the last one hangs
  • the network tab gives the following in the Timing tab for the the hanging request (it also shows nothing in the response tab):

Please also see the following post which details an issue in a similar context in the HtmlDialog in SketchUp:

Excellent info. Thank you. We’ve reproduced and are planning a fix for a coming release.

1 Like

This fix was released yesterday with our 2024.0.2 update.

1 Like