Pattern for removing temporary messages once app receives response from server
See original GitHub issueHello, first of all thank your for this great lib.
I have a question on what pattern makes sense to maintain temporary messages state. Given that a temporary message is added to the messages
prop the moment the user hits the send button but before the response is returned to the app there is no way to generate a matching ID locally (the server will return with its own messageID). What patterns are recommended to remove the temporary message?
Approach 1 match message text value
Off the top of my head I thought of matching the actual message text in order to remove the temporary message (once the response is received), but that does not feel right.
Approach 2 replace entire messages array with response
Replacing the entire messages array with what is returned from the network also does not take into account if the request failed
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Amazon SQS temporary queues - AWS Documentation
The most common use case for temporary queues is the request-response messaging pattern, where a requester creates a temporary queue for receiving each...
Read more >Scalable Request Response pattern using Azure Service Bus
To make this work, we will have to have one Request queue and multiple topics (one for each web server instance). This will...
Read more >Asynchronous messaging options - Azure Architecture Center
Learn about asynchronous messaging options in Azure, including the different types of messages and the entities that participate in a messaging ...
Read more >Part 4: RabbitMQ Exchanges, routing keys and bindings
Auto-deleted exchanges are removed once the last bound object is ... The exchange receives the message and is now responsible for the ...
Read more >Messaging - Apache Pulsar
Then, this consumed message will be permanently stored, and be deleted only after all the subscriptions have acknowledged it. If you want to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@waltermvp use renderFooter(){} to show local message in a list , when u press send button u get a local message from props save that message in a state and then use condition
<giftedChat> {...props} renderFooter={this.state.localMessage.length > 0 ? this.renderFooter() : null} </giftedChat>}
@nandiniparimi1107 you need to pass this.isTyping as extraData in giftedChat