Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11469

Race conditions when loading scripts async

    XMLWordPrintableJSON

Details

    Description

      Using this code in `index.html`

      <script src="cordova.js" async/>
      <script src="bundle.js" async/>
      

      causes all kind of weird side effects due to race conditions, I assume.

      As soon as I removed the async attribute (after one week of trying other things) everything worked, including the splashscreen. I think the splashscreen uses the message queue (event loop) to postpone some of its actions (when fading out) and this collides with the `async` attribute and creates a race-condition. It seems like a bug in wkwebview to not handle `async` script loading properly.

      Attachments

        Activity

          People

            shazron Shazron Abdullah
            pke Philipp Kursawe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: