Erudika / scoold-pro

Cloud-ready Q&A platform for the enterprise (self-hosted, on premise)
https://scoold.com
Other
7 stars 0 forks source link

Cannot push an existing thread in Slack as a question in Scoold #64

Closed shai-katzir-hs closed 6 months ago

shai-katzir-hs commented 9 months ago

reference : https://github.com/Erudika/scoold-pro/issues/55

I have installed the latest version 1.57.2 but I am still unable to create a Scoold question out of an existing thread.

I tried multiple approaches :

  1. message shortcuts - has only "answer in scoold" but no "ask in scoold"
  2. /scoold ask does not work in threads
  3. /scoold and "ask" does not respond
  4. /scoold and edit & ask on Scoold opens an empty page

expected

When I hit soold ask on existing thread, it will add the first message as a question and the rest of the thread as the first answer in Scoold

https://github.com/Erudika/scoold-pro/assets/143421098/34120aab-5c2d-45ab-a568-c4a426d05550

albogdano commented 9 months ago

Strange, you should have these three message actions: Screenshot from 2023-12-11 20-41-32 Perhaps your Slack integration is not configured properly? Make sure you have actually created the other two message actions, as described in the guide.

adi-zeevi-hs commented 8 months ago

Hi @albogdano how are you? We are trying to use the "edit and ask" command in threads, but when we click it nothing happens, maybe you can help us with this issue? Let me know if you need more information. Thanks :)

albogdano commented 8 months ago

You must configure the shortcut with the correct URL and with the exact callback ID as shown here: Screenshot from 2023-12-19 13-21-16

adi-zeevi-hs commented 8 months ago

Screenshot 2023-12-19 at 16 33 08

adi-zeevi-hs commented 8 months ago

@albogdano It seems like we configured it well

albogdano commented 8 months ago

Ok, looks good. Make sure the callback URL is directly accessible from the internet and not behind a firewall or reverse proxy. If it is, make sure all headers and request parameters to the Scoold server are unmodified by the reverse proxy.

albogdano commented 8 months ago

Slack signs each request to Scoold with a hash which Scoold verifies. If something is modified the request fails if the signature is invalid.

adi-zeevi-hs commented 8 months ago

We don't use any reverse proxy, or firewall, we simply have a load balancer that opened for slack

albogdano commented 8 months ago

Any errors in the Scoold logs? I suspect the load balancer is modifying the requests from Slack to Scoold and they fail the verification.

adi-zeevi-hs commented 8 months ago

There are no errors at all, we do see some logs about operations in Scoold for example: 2023-12-19 09:43:07 [INFO ] New question 'A question from Slack' from Slack myOrg/#tmp-test-scoold.

albogdano commented 8 months ago

Try the command /invite @scoold in your Slack channel. If there are no errors then maybe Slack doesn't have access to Scoold directly.

albogdano commented 8 months ago

Also try monitoring the access log of your load balancer and make sure you see requests from Slack to the /slack endpoint and the responses are 200 OK.

adi-zeevi-hs commented 8 months ago

@albogdano We checked and all works as expected

albogdano commented 8 months ago

So, is the issue resolved now? You seem to have two conflicting message shortcuts for the same action (edit & ask) - one is global and the other appears for each message. That could be problematic.

adi-zeevi-hs commented 8 months ago

@albogdano By saying "We checked and all works as expected" I mean that we checked the logs of the load balancer and all worked as expected.

This issue is still unresolved

albogdano commented 8 months ago

So, can you see requests coming from Slack to the /slack endpoint in Scoold wheb you click a shortcut button or use the slash command?

adi-zeevi-hs commented 8 months ago

Yes we can :)

albogdano commented 8 months ago

So, you click the "edit and ask" button on a thread and you see the request in your LB with a 200 OK status? That should return a payload to Slack and show you a dialog box. If not, your LB is likely blocking something.

adi-zeevi-hs commented 8 months ago

you can do the slash command and use Edit & Ask, it pops without the content of the threaded message

Screenshot 2023-12-28 at 14 23 11
albogdano commented 8 months ago

Using the slash command will always open a new question dialog with no content in it. If you click the "Edit and Ask" button on a threaded message you should see the content of the first message in the thread, displayed as text (question body) and no title (you need to write one). The other messages in the thread are not displayed because they will be created as answers to the question on Scoold. You can later remove the answers or edit them on Scoold if you have the rights to edit content.

shai-katzir-hs commented 8 months ago

Thanks! But we still see empty form when we click the "Edit and Ask" button on a threaded message .

albogdano commented 8 months ago

Perhaps it is something to do with the Slack API. Scoold would try to extract the text property of the first message and send it to the text field of the dialog box. I will check if there are any new changes to the Slack API which could cause this behavior.

adi-zeevi-hs commented 8 months ago

Thank you @albogdano

adi-zeevi-hs commented 8 months ago

Hi @albogdano how are you? Happy New Year! Any updates?

albogdano commented 8 months ago

Happy New Year! Unfortunately, I couldn't reproduce the issue at all. I've tried a few different approaches, including non-English text (like Hebrew) but I always get a dialog box with the message shown as body of the question which I can edit before posting.

I checked the Slack API for recent changes - no breaking changes. The text property is always shown and always contains the message text. Nowhere does the Slack documentation mention that it can be empty. So, my best guess is that your configuration or load balancer is causing the issue. It's hard for me to debug this further with the limited information that I have right now. Perhaps you could try running a single Scoold instance (without LB or proxy), on a single machine with direct access to Slack, and if all works well, progress from there. The fact that you get back a dialog box with fields and buttons is an indication that your Slack integration works properly but I have no explanation why the body of the message is not displayed.

shai-katzir-hs commented 8 months ago

Using the slash command will always open a new question dialog with no content in it. If you click the "Edit and Ask" button on a threaded message you should see the content of the first message in the thread, displayed as text (question body) and no title (you need to write one). The other messages in the thread are not displayed because they will be created as answers to the question on Scoold. You can later remove the answers or edit them on Scoold if you have the rights to edit content.

The current situation is that when clickong the "Edit and Ask" button on a threaded message it works as expected - the question is displayed as the "question body". But when submitting, the answers do not appear on the Scoold thread.

So the issue now is that the answers are not submitted as part of the Scoold question

albogdano commented 8 months ago

Thanks for clarifying @shai-katzir-hs! I saw what was going on and was able to fix it. The fix will be available in the new release of Scoold Pro next week.

shai-katzir-hs commented 7 months ago

Hello, is there a new version available ...

albogdano commented 7 months ago

Unfortunately, I had to be away from work for a few days and will probably publish the new version tomorrow. Thank you for your patience!

albogdano commented 7 months ago

@adi-zeevi-hs @shai-katzir-hs Scoold Pro 1.57.3 has been released.

shai-katzir-hs commented 7 months ago

Hi @albogdano , might be that we don't understand something.. When I have a post " this is post" and a thread post under it "this is thread post" , and I do "Edit & ask in Scoold" i expect the question in scoold to be "this is post" and the answer to be "this is thread post" . But I only get the question without answers. Screenshot 2024-02-07 at 10 14 56

I don't know if it is related, but we see errors constantly in the logs

albogdano commented 7 months ago

Your understanding is correct and Scoold will do exactly that if you click "Edit & ask" on the actual parent post "this is post". There should be a question "this is post" + answer "this is thread post" created in Scoold.

The errors you see in the console are not related but I think your server isn't working correctly - perhaps there's not enough memory or CPU to perform requests but I'm not sure exactly. Try restarting the server.

albogdano commented 6 months ago

@adi-zeevi-hs @shai-katzir-hs Were you able to get this working? As I said the errors in the logs are not related to the bug which was fixed in 1.57.3. If the problem with the "Edit & ask" button is resolved, can we close this issue?