sampaiodiego / rocket.chat.app-poll

Rocket.Chat App for creating polls.
MIT License
50 stars 39 forks source link

Poll not working correctly #14

Closed LAGonauta closed 5 years ago

LAGonauta commented 5 years ago

We were using poll version v0.0.3 installed from the marketplace and I recently updated it to version v1.0.0 to get the poll buttons, however we are unable to use the buttons to vote in the poll. According to the logs it seems to be working:

[34mI20190315-07:35:41.484(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "Kwf8LN7FySbs8ktJR" 
[34mI20190315-07:35:41.494(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message. 
[34mI20190315-07:35:41.762(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is searching for records that are associated with the following: [ RocketChatAssociationRecord { model: 'misc', id: 'd42c86dc-1848-480b-84cb-027179bd269c' } ] 
[34mI20190315-07:35:41.768(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating the record with association to data as follows: [ RocketChatAssociationRecord { model: 'misc', id: 'd42c86dc-1848-480b-84cb-027179bd269c' } ] { messageId: 'Kwf8LN7FySbs8ktJR',   options: [ 'Escolha 1', 'Escolha 2' ],   totalVotes: 0,   votes: [ { quantity: 0, voters: [] }, { quantity: 0, voters: [] } ] } 
[34mI20190315-07:35:41.779(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "Kwf8LN7FySbs8ktJR" 
[34mI20190315-07:35:41.790(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message. 
[34mI20190315-07:36:00.971(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is searching for records that are associated with the following: [ RocketChatAssociationRecord { model: 'misc', id: 'd42c86dc-1848-480b-84cb-027179bd269c' } ] 
[34mI20190315-07:36:00.975(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating the record with association to data as follows: [ RocketChatAssociationRecord { model: 'misc', id: 'd42c86dc-1848-480b-84cb-027179bd269c' } ] { messageId: 'Kwf8LN7FySbs8ktJR',   options: [ 'Escolha 1', 'Escolha 2' ],   totalVotes: 1,   votes:     [ { quantity: 1, voters: [Array] },      { quantity: 0, voters: [] } ] } 
[34mI20190315-07:36:00.986(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "Kwf8LN7FySbs8ktJR" 
[34mI20190315-07:36:00.995(-3) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message.

However the numeric value in the message is not getting updated. To update from v0.0.3 we had to uninstall the old one, and then install v1.0.0 as the update process wasn't working for some reason. The server was already restarted with no change to the poll behaviour. Tested on Firefox, Chrome and the desktop app. Any way I can better debug this?

Thanks.

sampaiodiego commented 5 years ago

do you guys have issues with updating regular messages as well? what rocket.chat version are you running?

from the logs it seems the app is doing fine.

LAGonauta commented 5 years ago

Sorry, forgot to add that. We are using Rocket.Chat from snap, stable. Current version 0.74.2. Yes, users can edit regular messages without any problem. We also have a timelimit in which users can edit messages, I do not know if this matters. (however the poll is still not working after disabling the limit temporarily)

Shaverdoff commented 5 years ago

0.7.4.3 vote buttondo not worked for as too.

[34mI20190319-12:00:14.488(4) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is searching for records that are associated with the following: [ RocketChatAssociationRecord { model: 'misc', id: '14f70fa3-056c-44d1-9d1a-c41937885265' } ] 
[34mI20190319-12:00:14.495(4) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating the record with association to data as follows: [ RocketChatAssociationRecord { model: 'misc', id: '14f70fa3-056c-44d1-9d1a-c41937885265' } ] { messageId: 'sYFLx7pid2yKxWPed',   options:     [ 'CID = Continous integration & Deployment без значка склейки',      'как то иначе' ],   totalVotes: 4,   votes:     [ { quantity: 4, voters: [Array] },      { quantity: 0, voters: [] } ] } 
[34mI20190319-12:00:14.502(4) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "sYFLx7pid2yKxWPed" 
[34mI20190319-12:00:14.507(4) The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message.
sampaiodiego commented 5 years ago

sry the delay guys.

So, I tried using latest stable snap release (which is now 0.74.3 - snap version 1367):

$ ls -l /var/lib/snapd/snaps/ | grep rocket
-rw------- 2 root root 235061248 mar 29 15:34 rocketchat-server_1367.snap

I didn't have any issues when installing the app from marketplace on a fresh setup..

I created a poll with the following command:

/poll "Question?" "Option 1" "Option 2" "Option 3"

and here are the logs from an successful vote:

mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is searching for records that are associated with the following: [ RocketChatAssociationRecord { model: 'misc', id: '2453af50-e683-4ac9-b358-68a1a3a200f1' } ]
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating the record with association to data as follows: [ RocketChatAssociationRecord { model: 'misc', id: '2453af50-e683-4ac9-b358-68a1a3a200f1' } ] { messageId: 'ntcc9canqjsh3L6yZ',
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:   options: [ 'Option 1', 'Option 2', 'Option 3' ],
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:   totalVotes: 1,
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:   votes:
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:    [ { quantity: 1, voters: [Array] },
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:      { quantity: 0, voters: [] },
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]:      { quantity: 0, voters: [] } ] }
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "ntcc9canqjsh3L6yZ"
mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message.

@LAGonauta did you get the snap update as well? is the app still not working?

@Shaverdoff can you tell me a bit more about your setup? like deployment method, MongoDB version, using Oplog/Replica set or not

is there anything else on app logs screen? if you guys go to MongoDB shell and look and the message object (the message _id is included on server logs) how that looks? the first item of the attachment field should have the options along with the votes, like this:


[
    {
        "color" : "#73a7ce",
        "text" : ":one: Option 1 `1`\n_@diego.sampaio_\n:two: Option 2 `0`\n:three: Option 3 `0`"
    },
    {
        ...
    }
]
Shaverdoff commented 5 years ago

Hi Diego! My setup is tar 0743 has 3 instance, mongo 3.6.8, set oplog/replica true

-- Gerasim Shaverdov | Deputy CTO | Altarix Mobile: +7 937 070 66 84 | Skype/email: gerasim@altarix.ru Lenina av.25, Samara, Russia, 443068

29 марта 2019 г., в 22:57, Diego Sampaio notifications@github.com написал(а):

sry the delay guys.

So, I tried using latest stable snap release (which is now 0.74.3 - snap version 1367):

$ ls -l /var/lib/snapd/snaps/ | grep rocket -rw------- 2 root root 235061248 mar 29 15:34 rocketchat-server_1367.snap I didn't have any issues when installing the app from marketplace on a fresh setup..

I created a poll with the following command:

/poll "Question?" "Option 1" "Option 2" "Option 3" and here are the logs from an successful vote:

mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is searching for records that are associated with the following: [ RocketChatAssociationRecord { model: 'misc', id: '2453af50-e683-4ac9-b358-68a1a3a200f1' } ] mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating the record with association to data as follows: [ RocketChatAssociationRecord { model: 'misc', id: '2453af50-e683-4ac9-b358-68a1a3a200f1' } ] { messageId: 'ntcc9canqjsh3L6yZ', mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: options: [ 'Option 1', 'Option 2', 'Option 3' ], mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: totalVotes: 1, mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: votes: mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: [ { quantity: 1, voters: [Array] }, mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: { quantity: 0, voters: [] }, mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: { quantity: 0, voters: [] } ] } mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is getting the message: "ntcc9canqjsh3L6yZ" mar 29 15:42:27 diegosampaio-thinkpad rocketchat-server.rocketchat-server[17845]: The App c33fa1a6-68a7-491e-bf49-9d7b99671c48 is updating a message. @LAGonauta did you get the snap update as well? is the app still not working?

@Shaverdoff can you tell me a bit more about your setup? like deployment method, MongoDB version, using Oplog/Replica set or not

is there anything else on app logs screen? if you guys go to MongoDB shell and look and the message object (the message _id is included on server logs) how that looks? the first item of the attachment field should have the options along with the votes, like this:

[ { "color" : "#73a7ce", "text" : ":one: Option 1 1\n@diego.sampaio\n:two: Option 2 0\n:three: Option 3 0" }, { ... } ] — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

LAGonauta commented 5 years ago

Yes, I got the snap update. Still not working, sadly :/

Shaverdoff commented 5 years ago

hi all ! have any update?

sampaiodiego commented 5 years ago

sry, no updates.. I cannot reproduce the issue :disappointed:

tried again a fresh snap install, it worked fine tried compiling rocket.chat version 0.74.3 source code, it worked fine tried with different users, with different access levels, it worked as well.

maybe can some of you give me access to your rocket.chat server? you can reach me out at https://open.rocket.chat/direct/diego.sampaio

sampaiodiego commented 5 years ago

thanks to @Shaverdoff we have found an issue related to the setting Keep Per Message Editing History.. if you have it set to true, the app will not work.

the fix requires a new Rocket.Chat release..

sampaiodiego commented 5 years ago

PR with a fix submitted https://github.com/RocketChat/Rocket.Chat/pull/14127/

Shaverdoff commented 5 years ago

and i after all purely intuitively asked about this parametrs...... the Q&A dies in me

LAGonauta commented 5 years ago

Thanks, just disabled that option and now it is working :)

sampaiodiego commented 5 years ago

I'll close this since Rocket.Chat 1.0 is already out containing the fix.