Socket message does not execute event on PWA

Wappler Version : dmxAppConnect 2.0.11 (and later)
Operating System :
Server Model:
Database Type:
Hosting Type:

Expected behavior

When a socket message is received at the client, it should be processed by the socket element

Actual behavior

On iOS the message is received but does not execute the event

How to reproduce

Works fine in 2.0.10, breaks in 2.0.11 and later.
All dmxAC recent versions including 2.0.11 work in Chrome and Safari desktop

This is the socket component:

<dmx-socket id="socket1" dmx-on:message.dashboard_refresh="run({condition:{if:`$event.tenant_id==current_tenant.data.settings.tenant_id`,then:{steps:{run:{action:`dashboard.load({},true)`,outputType:'text'}}},outputType:'boolean'}})" dmx-on:message.meal_plans_refresh="run({condition:{if:`current_tenant.data.settings.tenant_id==$event.tenant_id`,then:{steps:{run:{action:`meal_plans.load({},true)`,outputType:'text'}}},outputType:'boolean'}})" dmx-on:message.meal_plan_refresh="run({condition:{if:`$event.tenant_id==current_tenant.data.settings.tenant_id&amp;&amp;$event.meal_plan_id==query.meal_plan_id`,then:{steps:{run:{action:`content.meal_plan.load({},true)`,outputType:'text'}}},outputType:'boolean'}})" dmx-on:message.recipes_refresh="run({condition:{if:`current_tenant.data.settings.tenant_id==$event.tenant_id`,then:{steps:{run:{action:`recipes_all.load({},true);recipes_categories_published.load({},true);recipes_categories_unpublished.load({},true);recipes_scroll.load({},true)`,outputType:'text'}}},outputType:'boolean'}})" dmx-on:message.member_refresh="flow_refresh_data.run()" dmx-on:message.reactions_refresh="run({condition:{outputType:'boolean',if:`$event.tenant_id==current_tenant.data.settings.tenant_id`,then:{steps:{run:{outputType:'text',action:`get_reactions.load({},true)`}}}}})" dmx-on:message.posts="run({condition:{outputType:'boolean',if:`$event.tenant_id==current_tenant.data.settings.tenant_id`,then:{steps:{run:{outputType:'text',action:`content.activity_feed.get_posts.load({},true)`}}}}})" dmx-on:message.upsert_kitchen_prep_item="run({condition:{outputType:'boolean',if:`$event.tenant_id==current_tenant.data.settings.tenant_id`,then:{steps:{run:{outputType:'text',action:`get_kitchen_prep_item.load({entity_id: $event.entity_id, item_type: $event.item_type})`}}}}})" dmx-on:message.delete_kitchen_prep_item="run({condition:{outputType:'boolean',if:`$event.tenant_id==current_tenant.data.settings.tenant_id`,then:{steps:{condition:{outputType:'boolean',if:`$event.item_type==\'post\'`,then:{steps:{run:{outputType:'text',action:`all_kitchen_prep_items.delete({post_id: $event.entity_id})`}}},else:{steps:{condition:{outputType:'boolean',if:`$event.item_type==\'meal plan\'`,then:{steps:{run:{outputType:'text',action:`all_kitchen_prep_items.delete({meal_plan_id: $event.entity_id})`}}},else:{steps:{condition:{outputType:'boolean',if:`$event.item_type==\'recipe\'`,then:{steps:{run:{outputType:'text',action:`all_kitchen_prep_items.delete({recipe_id: $event.entity_id})`}}},else:{steps:{condition:{outputType:'boolean',if:`$event.item_type==\'pantry item\'`,then:{steps:{run:{outputType:'text',action:`all_kitchen_prep_items.delete({pantry_item_id: $event.entity_id})`}}}}}}}}}}}}}}}}})"></dmx-socket>

I can see in dev console that the message is received.

However the server connect reloads that are triggered by the socket do not execute.

Does this only occur on iOS and not on desktop?

I did more testing this morning.

These 3 work:

  • Chrome desktop
  • Safari desktop
  • iOS simulator on mac desktop

The only one not working is a real iPhone. The message comes in as verified in the dev console, but nothing runs.

Now that I have added the simulator, and that works, I wonder if it is a timing issue that only shows up on the device?

As soon as I revert to 2.0.10, problems goes away.

Can you clear the cache on the iPhone browser and test again. Perhaps connect your iPhone with your Mac and check in devtools if there are any errors.

Is it a standard website with bootstrap or a framework7 app?

Thanks Patrick.

BS5. Clearing various caches had no change.

I narrowed it down further to PWA because both Safari and Chrome work fine on iOS, which makes sense since they use the same kit.

With 2.0.10 all works in PWA.

2.0.12 the message is received, but no events trigger. There is nothing relevant in the console. On each test I confirm the version of dmxAppConnect in dev console, and have deleted the pwa from the device and reinstalled. Each time it works with .10 and breaks with .12.

Very odd.

I'll expand the tests a bit later to include a different iPhone and a Droid.

@patrick

Latest tests show it only happens when in a PWA, on both Android and iOS when using 2.0.12. Confirmed on 1 Android device and 2 iPhone.

All browser only work fine.

Where is the dmx-socket component located, is it in the main page or on the content page?

It is on the layout.

Does it work normally when accessing it in safari on the iPhone or does it always not work on a mobile device.

How did you create the PWA, do you have a service worker for that?

Yes, Safari on iPhone works fine.

PWA is using Progressier which handles all matters of the PWA including service worker. I can dm you a link to install if that would help.

And you have the same problem with App Connect 2.0.11?

Correct.

Fixed in Wappler 6.7.3

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.