-
Notifications
You must be signed in to change notification settings - Fork 247
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
GraphQL subscription with AppSync custom domain fails; stream failed after AWS is configured with message "Exception from WebSocketService". #3028
Comments
Hi @NajAkkad can you please provide more information explaining what you've done so we can reproduce?
|
Thanks for replying!
and this is the configuration file used:
|
Hey @NajAkkad, thanks for over those details. Could you also provide:
|
Sure.
Note:
|
@NajAkkad The only way I was able reproduce this error was by forcing Amplify to try to subscribe to a non-AppSync URL (like API gateway). I was wondering if some configuration you are using caused the wrong URL to be used at runtime. I had a few more questions:
|
Thanks @ragingsquirrel3 ! 1- Subscription is working well from the same URL, also one note is that this is working fine when I am working on amplify version To iterate more on point one, app was working fine using amplify |
After checking more and more I would like to state one thing. The reason this was happening is that we are using our own custom domain, which directly link to AppSync, that's why it was failing, but keep in mind that even like this it was working on older versions. (Our custom url provided was ending with Now we changed url to the direct AppSync one, so it worked. |
I have this same problem, we tried to change the url as mentioned by the partner and still it continues without connecting. Is there any other solution? |
@NajdatAlAkkad and @Stivenmore I think this might be making sense but I wanted to get some more info to confirm my understanding. When you say "custom domain," you mean you have configured appsync custom domain like https://docs.aws.amazon.com/appsync/latest/devguide/custom-domain-name.html? If so, I suspect this is a bug with an easy fix in amplify-flutter because Android handles this use case in a way Flutter does not (see Android code). Before putting out a fix, I wanted to get more info to confirm this issue and recommend workarounds. That would explain why changing to direct AppSync fixed this. @Stivenmore when you say you "changed the URL" did you change to direct AppSync (which should work) or otherwise change the URL? If you changed to direct and it still didn't work, that is still unexplained. However, if it's a custom domain then tweaking a few characters won't work because the URL must have "/realtime" appended (at runtime) at the end to work. I think the bug is that Android is correctly making this modification at runtime so it's not necessary in the config and amplify-flutter simply doesn't handle this case. edit: Nevermind, this won't work Thanks again for the info and for bringing this issue to our attention. |
I was able to reproduce this bug with a custom domain so I will mark this a bug and change the title. I also noticed that changing config file to append "/realtime" will not work (counter to what I said in last message) bc the plugin sets the path to /graphql ignoring the path in config. I will work on getting a fix. In the meantime, I think the only workaround is to use the direct appsync URL. |
@ragingsquirrel3 Thanks for the help with this case, as you mention I will wait for the release of the version with it solved and I will try. |
The fix for this has been released. |
Description
After running the application and configuring AmplifyAPI plugin, when subscribe method is called it fails and returns this exception:
Categories
Steps to Reproduce
Mentioned in description
Screenshots
No response
Platforms
Flutter Version
3.7.11
Amplify Flutter Version
1.0.1
Deployment Method
Amplify CLI
Schema
No response
The text was updated successfully, but these errors were encountered: