Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch conversationId expired from ChatService #18

Open
aledeloss opened this issue Jul 12, 2023 · 1 comment
Open

Dispatch conversationId expired from ChatService #18

aledeloss opened this issue Jul 12, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@aledeloss
Copy link

Hi, many thanks for the library, it's great!
I am having an issue when I need to do other actions rather than adding a message in ChatService. In particular, I would like to have the chance to dispatch other events from the ChatService to the chat, such as a conversation id expired or others. I am storing the conversation id in the backend and validating it on each message. If it expires, I need to create a new one, and readd former messages to the new conversation. This requires that ChatService can somehow inform the chat that that a new conversation id must be requested and then a new conversation created, etc. before actually sending the message to the server.
I checked that you set other events, but I am not sure how can I use them and how can I listen to them, am I missing something? Thank you very much in advance!

@supersnager supersnager self-assigned this Aug 23, 2023
@supersnager supersnager added the question Further information is requested label Aug 23, 2023
@supersnager
Copy link
Contributor

@aledeloss I think you don't need to tell the chat that something has changed, because storage.updateState does that.
When you know in the ChatService that you need to change the message id, just replace the message in the storage and call storage.updateState. The UI will reflect the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants