C
C#16mo ago
linqisnice

❔ signalr optimistic updates excluding the connection of the user posting the message

So, I'm using signalr IHubContext to push a notification from server to client after I've confirmed that Twilio Conversations rest api has successfully persisted the message with the webhook i've set up. I do this to ensure data consistency, but it does introduce some delay. But i want an optimistic update strategy for the author of the message, so the connection from which the message is originally posted should not receive the signalr notification. I thought I should do this on the server, by wiring up some logic to get that users connectionid and excluding it in the notification... but it seems like a lot of work. is this a common problem? if so, what solutions are available? I thought of passing along a message ID to the client and then the client can ignore that signalr message for the author. Is that a viable approach?
4 Replies
Tinefol
Tinefol16mo ago
Assigning the messages unique IDs is generally a good idea for consistency across architecture. I don't see any downsides. You do not want to see something: you ignore it, based on some condition.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
linqisnice
linqisniceOP16mo ago
@MangoDbit's not a full-fledged chat app but a subsystem, so not that important that it's perfect. what i've done rn is i pass in some unique identifier with the message from teh client, and on the client i dedupe the signalr message based on that id
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server