oddsdk / odd-app-template

A sveltekit web app template for the ODD SDK.
https://odd-template.fission.app
MIT License
29 stars 10 forks source link

Device linking reliability #100

Open jeffgca opened 1 year ago

jeffgca commented 1 year ago

I've done some testing of device linking and it is uh reliably unreliable; in numerous tests with various browsers / OS, device linking stalls:

  1. in browser A, open the devtools and network tab and filter by 'WS'. Notice there seems to be 2 connections? Click on one connection to view the messages
  2. in browser A, click on "connect an additional device", then copy the url
  3. in browser B, paste and go to the url, then open the devtools / network tab and filter by 'WS'.

What happens:

{
"iv":"aODILVs2hrs6aCaSEgbP+g==",
"msg":"Rss0HEgjpecVMPpbvUBu4rvsUetzSvCfDZNhzozXQpjBFkvBMEUYbx9OpRnPmsv0HrWGDxczg7U7FMJaH8bJSMdidj9t+Srt25jsq3R7n51xyMCi7pfQORzRZoP+SI63cP65J4/6ZNi4iBzQTedod6nw9An09VDOfzkoo1Nw26RaE7Iupepa6/LzaOU6O+cebD6wm3+SMwBVvgxnw3S3uokJwV2uVs0f7lsxkKhjGc9/7hyNx+HdnQOBkXJi7duq5ybRAMFvKa6TUBzYqDlxKrRU7eHOkh9oV6JvgXtn5tZfjUehtgHxbPX+5D0hxGSfgGZVs6rwHflGE5uXwhEd0SBpyb5ch8KpQgJW/SPsi2fPYE9klErz0iisDOCI92OvOL0P+0ta0RXhnmI4R7xOqiTqUyjD+Ogw/8zOEnMZkYiOOjvKe34eJ5DIU5TSQ6d3RlnRtxfJPsFyghIEFHtg2QBEmmG4XJeyH6btPECGNbjFIlrokCLFAPRJq0J5POOwqw011eOxYepOsFpjbu7IZMFUSzxbPllVxej+AVzfKgHc7GtK27B8Io++Y41fgRiIbqMh7CcuMfHCp8WaGdxqVqUwjqLweTWrjYZjI38="}

When the browsers are in this state, I have seen it start working after refreshing browser A, but this is not reliable.

In a successful device linking session I see WS messages being sent from browser A in response to browser B, but this never happens on the first attempt to link.

jeffgca commented 1 year ago

As a first step on this issue - we should deploy and test with versions of WAT etc and webnative 0.34, not the currently deployed version. No use in trying to fix a bug that's already fixed.

icidasset commented 1 year ago

Andy fixed this issue in the 0.35 branch The issue was indeed that the connection was opened multiple times.

bgins commented 1 year ago

I've attempted a reproduction in https://github.com/fission-codes/aol-demo/tree/upgrade-webnative-0.35.0 to gather more information from a second app.

The issue was not reproducible on a couple of attempts linking between desktop browsers including:

There were however issues linking from Desktop Firefox to Chrome on iOS. The symptoms are a bit different. Using chrome://inspect logging, the following is logged:

chrome-inspect

These messages are logged here: https://github.com/fission-codes/webnative/blob/3bd09cdd70d24d6df32cf9630d6565b9b2beff5b/src/components/auth/channel.ts#L53-L87

It seems like this should make more than just two attempts.

bgins commented 1 year ago

Safari iOS has a similar issue as Chrome on iOS.

Starting the linking process there while debugging in macOS Safari shows the following output:

safari

As with Chrome on iOS, we are only making two attempts.

bgins commented 1 year ago

The Chrome on iOS and Safari iOS issues with retries described above are fixed in https://github.com/fission-codes/webnative/issues/446.