Socket.io errors on mobile app with Beta 2

Wappler Version : 6.0.0 beta 2
Operating System : mac
Server Model: node
Database Type:
Hosting Type:

Expected behavior

Socket.io should continue to work as it did previously

Actual behavior

socket.io repeatedly generates

Failed to load resource: Origin is not allowed by Access-Control-Allow-Origin. Status code: 200

How to reproduce

Update to beta 2, recompile mobile app project and run in simulator.

Question on this…Does AC2 on a mobile app, require AC2 or some other updates on its corresponding web app?

Seems like a general cors problem to me, not really related to the beta’s

For mobile apps you have to specify pretty strict cors origin settings, I think we had a whole topic on this before.

Everything has worked fine for a year. This may not be related to AC2, but it only happens with 6.0.0 beta 2.

Maybe @patrick can check I think he had some changes in the fetch in ac2 about this

Do normal server connect calls without sockets work?

I have an update that adds the cors config to the socket server, I assume that you have configured cors on the server.

File is for Server Connect, not App Connect.
sockets.zip (1.6 KB) unzip to lib/setup.

If this does not work then I will post an update for the client, the previous client only connects with websockets and fails when websockets didn’t work. The new client starts with polling and then upgrades to websockets if it is available. Also serverconnect components in the new Beta fallback to standard fetch request when websockets are not connected.

Yes, but the socket trouble prevents most anything from working. The app loads but does not display much beyond the basic layout of the app

Correct, I set an array of values that are necessary for iOS (I believe Android connects fine without.)

"cors": {
    "origin": [
      "app://mobileme.mpp-staging.uniqueideas.com",
      "app://mobiledemo.mpp-staging.uniqueideas.com",
      "app://cmm.staging.mealproapp.io",
      "app://nuc.staging.mealproapp.io",
      "app://gmd.staging.mealproapp.io",
      "app://peasandhoppiness.staging.mealproapp.io",
      "app://keto.staging.mealproapp.io"
    ]
  },

I applied this, and the error for iOS has changed. I note iOS, because it now has (what I believe is) the error that Android had yesterday. I think this is due to the way the 2 platforms connect differently.

So I would say that the CORS issue is gone.

Here are the current errors:


Update for the client: dmxSockets.zip (1.0 KB)

I’ve changed the transport to websocket only here, so it should not use any polling. Please check if that helps.

Let’s call this resolved as all the socket errors are gone.

This is perhaps an unrelated issue, and I’ll open up a new thread.

Not sure if it is fixed if content still is not showing, do you get data from the websockets. Having no errors doesn’t mean that they work.

See: