Hello, I want to implement an edit message feature to an app using Vue JS and the latest version of tinode sdk for JS. I have also tried the next branch but with no success.I am facing an error from the SDK and I don't understand if it's because of something I do wrong or something wrong with the SDK.
What's happening
I use await this.topic.publishMessage(pub) (inside async function) in order to send an edit for a message. The pub object that is sent is as follows
const pub = {topic: this.topic.name,head: { replace: `${this.topic.name}:${this.item.seq}` },content: this.content,noecho: true}This is the error I recive in console. I catch the error in a try/catch block.
The topic is subscribed and everything else works.Here is the line from electron sources tab from dev console that is specified in error.
What's it a bit weird is that the pub is sent to the server, registered and it affects the other use in chat. He can see the edit.
Meanwhile there are no problems sending "normal" messages.
I have installed it with npm install. The project is with nuxt.
How could I change the tinode source js to dev ?
What I mean is that:
1) 2 users, A and B have a chat2) User A edits one of their message.3) User A get's the error but the edit is sent on {pub} with header: {replace:topicname:msgseq} and user B recieves the edited message on {data}. Some client side code happens that replace the old message with the new one.
If user A wasn't subscribed to the topic, how could the {pub} be sent anyway and recived by user B ?
I could guess that it has something to do with http://tinode.github.io/js-api/tinode.js.html#line3769 and line 3786. Considering the error about using then on undefined.What logs from sending normal messages ? There are no erros, it works well. Also here I use publishDraft with a pub made by createMessage . Meanwhile when I edit the message the pub is made by me as an object(see the const pub from the first post)
On Oct 6, 2021, at 08:42, Gene <ge...@tinode.co> wrote:
--
You received this message because you are subscribed to the Google Groups "Tinode General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/aa3e7365-c392-4c6c-a7be-016c18e1ea02n%40googlegroups.com.
What should I build ?
I am not using the react app. I using tinode-sdk in VueJS. I also have a server. On the server everything is ok.
From package.json.
I have no more logs than what I gave you about that error. All can I do is add more console.logs, but what should I log ?
--
You received this message because you are subscribed to a topic in the Google Groups "Tinode General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tinode/yWSF14ZXJ5w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/f6ac5814-feab-4708-b3b1-9f1e3968a8a4n%40googlegroups.com.
The first pub has an id because I use topic.createMessage before sending it with topic.publishDraft