Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

not receiving messages in real time. #70

Open
Meenakshi14 opened this issue May 11, 2021 · 4 comments
Open

not receiving messages in real time. #70

Meenakshi14 opened this issue May 11, 2021 · 4 comments

Comments

@Meenakshi14
Copy link

I followed the instructions and i am able to run the app but when i am exchanging messages between 2 users, I have to refresh the page every time to get the message instead of having it in real time.

@Xyloboard
Copy link

I have the same issue - can we get an update on this please?

IT looks like a subscription error in the graph QL

ObservableQuery.js:215 Unhandled GraphQL subscription error Error: Response not successful: Received status code 400
at throwServerError (httpLink.js:31)
at httpLink.js:54
at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17439)
at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
at zone.js:889
at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17430)
at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)

@Xyloboard
Copy link

Ok, I've solved the issue:

Appsync now forces websocket connections for subscriptions, this happens by default in the latest package. To fix the starter, upgrade "aws-appsync": "^4.1.1",

and fix a couple of dependancies -

import { AUTH_TYPE } from 'aws-appsync/lib/link/auth-link'; to
import { AUTH_TYPE } from "aws-appsync";

There was also a ts type error which I fixed - then it works like a charm!

@lyvyu
Copy link

lyvyu commented Aug 6, 2021

@Xyloboard thanks mate, good catch on this.

I also tried using Apollo graphql client, but when it comes to tight WebSocket connection that's a nightmare, I did not manage till the end to do that.

szf5 added a commit to szf5/aws-mobile-appsync-chat-starter-angular that referenced this issue Oct 3, 2021
@szf5
Copy link

szf5 commented Oct 5, 2021

Please ignore the related commit message above. I'm still testing this project locally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants