Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error resolving Fission server DID message #131

Open
youk opened this issue Oct 13, 2023 · 5 comments
Open

Improve error resolving Fission server DID message #131

youk opened this issue Oct 13, 2023 · 5 comments

Comments

@youk
Copy link

youk commented Oct 13, 2023

What is the status of this app template? Is it supposed to work? Can the app proceed beyond the "Initializing file system" screen hanging for indefinite time?

Tried registering at:
http://localhost:5173/
https://odd-template.fission.app/

Result:
"Initializing file system" screen

Browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dns.google/resolve?name=_did.runfission.com&type=txt. (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cloudflare-dns.com/dns-query?name=_did.runfission.com&type=txt. (Reason: CORS request did not succeed). Status code: (null).
@bgins
Copy link
Member

bgins commented Oct 13, 2023

Hi @youk 👋 . Thanks for opening the issue.

This is an issue for the ODD SDK. Would you mind opening an issue over here: https://github.com/oddsdk/ts-odd.

As a quick note, I think I've seen this error, but only at one specific coffee shop in a town nearby me. My theory is they have some router configuration that prevents these DNS lookups. It might be worth trying at another location to narrow down possible causes.

@bgins bgins changed the title Status of this template CORS error resolving DID Oct 13, 2023
@youk
Copy link
Author

youk commented Oct 13, 2023

Thanks for your reply, I'll go there.

As for the issue itself, the browser clearly complains about CORS violation. I don't quite understand how changing DNS configuration should help. Unless those queries are only made as fallback option.

@youk youk closed this as completed Oct 13, 2023
@bgins
Copy link
Member

bgins commented Oct 13, 2023

As for the issue itself, the browser clearly complains about CORS violation.

Browsers sometimes complain about CORS issues when root cause is something else.

I don't quite understand how changing DNS configuration should help. Unless those queries are only made as fallback option.

This lookup is an essential part of the ODD SDK. We use it to look up the DID of the Fission server. It can be seen in action here: https://dnsrecords.io/_did.runfission.com.

We are making the query from JavaScript using DNS over HTTPS, instead of the browser resolving a DNS record.

This approach is newer, and that along with only experiencing this error in certain locations makes me suspicious of a router configuration. Could be something else though! I haven't investigated it enough to say.

@youk
Copy link
Author

youk commented Oct 15, 2023

Thank you for the explanation. It was a misleading error message from the browser indeed. The current configuration of my router blocks queries to Cloudflare/Google DoH JSON APIs (and probably others).

I still have two things to ask:

  1. Couldn't the error handling in the app be improved? I mean not the indefinitely spinning "Initializing file system" screen, but a meaningful error message after DoH query fails? It seems the responsibility of an app, not the SDK.
  2. Were you thinking about making this address resolution procedure more fail-proof? I don't have hands-on programming experience with DoH, but when I try with "Use CORS Proxy" option on https://dohjs.org/, the resolution works even in my configuration. I am not saying that my router's behavior is correct (it is the effect of ad-blocking enabled), but this is OOTB feature and when enabled it will break things for other people too.

@bgins
Copy link
Member

bgins commented Oct 16, 2023

Thanks for looking into this further! ❤️

Couldn't the error handling in the app be improved? I mean not the indefinitely spinning "Initializing file system" screen, but a meaningful error message after DoH query fails? It seems the responsibility of an app, not the SDK.

Yes, indeed. We could have a better error message here. I'll re-open this issue and change the title.

Would you be interested in adding a better error message? I think I can test it out at that local coffee shop, assuming they haven't changed their router config.

Were you thinking about making this address resolution procedure more fail-proof? I don't have hands-on programming experience with DoH, but when I try with "Use CORS Proxy" option on https://dohjs.org/, the resolution works even in my configuration. I am not saying that my router's behavior is correct (it is the effect of ad-blocking enabled), but this is OOTB feature and when enabled it will break things for other people too.

It's something we can investigate. If you are still up for it, an issue in https://github.com/oddsdk/ts-odd would be appreciated. Our current focus is IPVM, so we may not get to it right away.

@bgins bgins changed the title CORS error resolving DID Improve error resolving Fission server DID message Oct 16, 2023
@bgins bgins reopened this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants