webxdc / store

XDC store, migrated to codeberg
https://codeberg.org/webxdc/store
5 stars 0 forks source link

Frontend does not display application list on Android with WebView 74 #42

Closed link2xt closed 1 year ago

link2xt commented 1 year ago

Currently deployed version dc62667899f5964d551987f4ce3c9bc8df055b98 does not display the list of applications.

This is what I get right after opening the app:

![1](https://github.com/webxdc/appstore-bot/assets/18373967/6f64db55-6ff6-432a-976c-fc61c7c5f07b)

When I click to refresh, "Updating..." text appears and the spinner animation starts:

![1](https://github.com/webxdc/appstore-bot/assets/18373967/963ffacb-d5f4-4dc2-b5eb-d51b45624197)

On desktop the list of applications is displayed correctly:

![1](https://github.com/webxdc/appstore-bot/assets/18373967/10eb8d85-f421-466a-b66d-111cb04c902b)

My WebView version is "Android System WebView" 74.0.3729.186.

This is an improvement since #7, at least the UI displays, but still does not work.

link2xt commented 1 year ago

I have connected the phone to the laptop with USB and ran adb logcat on the laptop, collected this log:

06-14 20:13:19.856  8285 28193 I WebxdcActivity: sendStatusUpdate
06-14 20:13:19.874  8285  8285 I WebxdcActivity: handleEvent
06-14 20:13:19.911  8285 28193 I WebxdcActivity: getStatusUpdates
06-14 20:13:19.947  8285  8285 I chromium: [INFO:CONSOLE(1)] "Uncaught (in promise) TypeError: Object.hasOwn is not a function", source: https://acc19-msg290929.localhost/assets/shop-e1fc8b28.js (1)

According to MDN Object.hasOwn() is only available since Chrome 93.

link2xt commented 1 year ago

It seems setting the build.target option to target chrome74 in #27 is not enough to fix this. We either need to provide a polyfill or stop using Object.hasOwn() in the code.

link2xt commented 1 year ago

Made a fix: #46