PharmaLedger-IMI / acdc-components

UC4 Anti-Counterfeiting Data Collaboration
MIT License
3 stars 4 forks source link

Lack of permission to share location on Safari causes "Patient Wallet" to freeze after scan #9

Closed joaoluis-pdm closed 3 years ago

joaoluis-pdm commented 3 years ago

On v0.5.9, on the "Patient Wallet" running on a Safari browser, after scanning a data matrix, if the user denied location sharing, the application hangs with a blank screen saying "Scan done," and stops there. image

There is a JS error on the console log.

[Log] Acdc Settings Added (acdc.js, line 113)
[Log] Uploaded settings.json to /data/settings.json (DSUStorage.js, line 42, x2)
[Log] Uploaded languages.json to /data/languages.json (DSUStorage.js, line 42)
[Log] Uploaded settings.json to /data/settings.json (DSUStorage.js, line 42)
[Log] Random new DID generated: A18ibqUvcQH8JuGcuUsyFXQAR2znzkAiD9F78LRvv1s4u3q36gnrTzudVLvc2MiHKjPsgp2M4HZnFamfRcGLd841QkXceFAvZp777Jwptwx9DMUszRTRx2up6ykxoqmBikxWgXwMkmbaFJDZQsXbiVdh7kTDUXu3nkVfakFrLT1o8KzTQKpGVBeqXdBKMLLr7JmMMy6RdKfypH4yH3d8nMaoQxGruZbGYKUZopFMR8uS2hhdQUH3ywKfujpuUQC5Gxw7dC4JnUjvwgmyY8P1uhfDSZDvUt54HqkURF6U8H4p5rKPbiZRHoR94XDnyakARpAbrim2iuXvPTakid8hHPWVr7fcFs (acdc.js, line 125)
[Log] Uploaded settings.json to /data/settings.json (DSUStorage.js, line 42, x2)
[Error] Failed to load resource: the server responded with a status of 404 () (index.js.map, line 0)
[Log] Trying to play video that is already playing. (iframeBoot.js, line 22635)
[Log] result – Result {text: "\u001d01021131000000112143023992515022\u001d10MAY1701\u001d17220429", rawBytes: Uint8Array, numBits: 240, …} (p-f126c525.entry.js, line 1)
Result {text: "\u001d01021131000000112143023992515022\u001d10MAY1701\u001d17220429", rawBytes: Uint8Array, numBits: 240, resultPoints: Array, format: 5, …}Result
[Error] Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
    (anonymous function)
    rejectPromise
    play
    (anonymous function) (p-f126c525.entry.js:1:8599)
    loop (zxing.js:3464)
[Log] New GTIN_SSI in domain:epi and bricksDomain:undefined (gtinResolver.js, line 73)
[Log] User denied the request for Geolocation. (acdc.js, line 218)
[Error] TypeError: JSON.stringify cannot serialize cyclic structures.
    stringify (acdc.js:262)
    (anonymous function) (acdc.js:262)
    (anonymous function) (acdc.js:233)
[Error] TypeError: null is not an object (evaluating 'this.scannerContainer.appendChild')
    addCanvasToView (p-f126c525.entry.js:1:939)
    createOverlaysCanvases (p-f126c525.entry.js:1:1207)
    drawOverlays (p-f126c525.entry.js:1:8095)
    (anonymous function) (p-f126c525.entry.js:1:7896)

image

The correct behaviour should be to report the scan without the GPS info (as it happens in google chrome).

joaoluis-pdm commented 3 years ago

Fixed on 2885ebdfe1b7bf849d04620faba026f965d3aaa2

joaoluis-pdm commented 3 years ago

Re-testing on DEV env... Release v0.5.10

joaoluis-pdm commented 3 years ago

Fix evidence by S.Mota:

pwallet scan1 scan2

Ok to deploy.