410 Gone means the connection is already gone (=the client is disconnected) or the connection is not established yet.
Are you trying to call postToConnection in $connect route integration? In the case, the connection is being established (which means not established yet), so you can't use postToConnection.
Thank you for your help. I guess the truth is that I call postToConnection in connect handler and in this handler the connection has not been established. Then I separated the postToConnection code into the default handler and called it manually that worked eventually.
Sorry to revive an old thread, but what about when the $disconnect route is called. When a user disconnects, I'm iterating over my list of other connections and attempting to send a message to all other users that someone has disconnected, but I get the
SerializationError: 410 Gone
error for all connections, and I know the others haven't disconnected.
As long as you invoke postToConnection to other available connections, it should not be a problem. $connect/$disconnect only affect the specific connection. You may need to check you are passing correct connectionIds.
Cool. Thank you. Your response made me dig a little deeper and it did end up being an issue on my end.
- asked 4 years ago
- Accepted Answerasked 4 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 5 months ago
- How can I pass a connectionId or custom token to VPC Link integration as a header for Amazon API Gateway WebSocket APIs?AWS OFFICIALUpdated 5 months ago
- EXPERTpublished 5 months ago
- EXPERTpublished 8 months ago