Ravi Sir's Cards › AWS
Handle GoneException
This revision card explains Handle GoneException. It starts from the need that clients leave without a clean $disconnect (closed laptop). Stale connectionIds break broadcasts. It describes postToConnection on a dead id raises GoneException (410). Delete that connectionId and continue. The how-to section notes try/except around post_to_connection; on GoneException delete the DynamoDB row for that connectionId. An example on the card is broadcast to 5 ids where 1 is stale , then 4 get the chat line; stale row is removed automatically.
Read card text
What this card says
Why do we need it?
Clients leave without a clean $disconnect (closed laptop). Stale connectionIds break broadcasts.
What is it?
PostToConnection on a dead id raises GoneException (410). Delete that connectionId and continue.
How to do it
try/except around post_to_connection; on GoneException delete the DynamoDB row for that connectionId.
GoneException
Example
Broadcast to 5 ids where 1 is stale → 4 get the chat line; stale row is removed automatically.