Azure / Azure/azure-webpubsub

Documentation on handling `SendMessageError`

Open
#806 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
147
Forks
96
Avg merge
19h 28m
Merged PRs (30d)
87

Description

# Give us your feedback about our samples

## Which sample do you want to give feedback?
https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-web-pubsub/reference-client-sdk-javascript.md#4-send-messages-to-a-group

### The sample is not what you want?
In production, we have occasionally run into the following error:

Type: SendMessageError
Message: The connection is not connected.
File:
Stack: SendMessageError: The connection is not connected.
at aVn._sendMessageWithAckId @
at async aVn._sendToGroupAttempt @
at async aVn._operationExecuteWithRetry @
at async aVn.sendToGroup

What is the proper way to handle this error?

Should we be checking the connection status before calling sendAsync? In other words, track status via client.on('connected') and client.on('disconnected'). And in that case, while the status is "disconnected", we would need to store all attempted messages so they can be resent once the client has successfully connected? Or does this library do all of that for us already?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked azure-web-pubsub JavaScript client sample at the “Send messages to a group” section. Verify how SendMessageError, connection events, retries, and message resending are handled, then document the supported behavior and recommended response to a disconnected client.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
documentation, networking
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.