Problem with duplicate comment ID.
Closed this issue · 2 comments
Hello! I have a new problem with the addon. Comment IDs can be saved in duplicates if, for example, two users post comments within a period of time without reloading in DOM.
Example: User 1 posts a comment 2 minutes after loading the DOM. In that time interval, user 2 also posts a comment. Since the id is generated on the client taking into account the comments matrix downloaded in the getComments call, both comments will be sent to the server with the same id, which will then cause the comments to not load correctly.
Any ideas to request this?
It had occurred to me to call getComments every X time (for example 5 seconds), to keep the comments matrix updated, but I find a horrible solution. I also thought that, before creating the comment, make a call to getComments to get all the comments at that time on the server and thus assign a unique ID to the new comment before saving it, but I have no idea how to do it.
Thank you!
Try using auto increment keeping id as primary in your database. dont use the comment id which the system provides it might solve this problem
Thank you @Rohitgowda ! Problem solved