jason0x43 / alfred-slack

An Alfred workflow for Slacking
MIT License
5 stars 0 forks source link

slu not working #4

Open BoD opened 4 years ago

BoD commented 4 years ago

Hi!

I see that a similar issue was logged here but I'm not sure I'm hitting the same.

Basically slu is returning "No results". Here's what I see in the logs:

[10:51:59.821] Slack[Script Filter] Queuing argument ''
[10:51:59.905] Slack[Script Filter] Script with argv '' finished
[10:51:59.906] STDERR: Slack[Script Filter] [alfred] 2020/08/10 10:51:59 Alfred version: 4.1
[slack] 2020/08/10 10:51:59 Args: []string{"./alfred-slack", "", "{\"keyword\":\"users\"}"}
[slack] 2020/08/10 10:51:59 Using config file /Users/bod/Library/Application Support/Alfred/Workflow Data/com.jason0x43.alfred-slack/config.json
[slack] 2020/08/10 10:51:59 Using cache file /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/cache.json
[slack] 2020/08/10 10:51:59 Using emoji dir /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/emoji
[slack] 2020/08/10 10:51:59 loaded config: {redacted}
[slack] 2020/08/10 10:51:59 loaded cache
[alfred] 2020/08/10 10:51:59 set keyword to 'users'
[alfred] 2020/08/10 10:51:59 tell: data=alfred.workflowData{Keyword:"users", Mode:"tell", Mod:"", Data:""}, arg=''
[alfred] 2020/08/10 10:51:59 Skipping disabled command 'token'
[alfred] 2020/08/10 10:51:59 Adding items for 'users'
[alfred] 2020/08/10 10:51:59 loaded cache
[10:51:59.908] Slack[Script Filter] {"items":[{"title":"No results","arg":"{}","valid":false}]}

If I have a look at /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/cache.json I see "Users": null,, but the rest looks OK.

If I first clear the cache and try slu again here are the logs:

[10:54:11.931] Slack[Script Filter] Queuing argument ''
[10:54:12.456] Slack[Script Filter] Script with argv '' finished
[10:54:12.459] STDERR: Slack[Script Filter] [alfred] 2020/08/10 10:54:11 Alfred version: 4.1
[slack] 2020/08/10 10:54:11 Args: []string{"./alfred-slack", "", "{\"keyword\":\"users\"}"}
[slack] 2020/08/10 10:54:11 Using config file /Users/bod/Library/Application Support/Alfred/Workflow Data/com.jason0x43.alfred-slack/config.json
[slack] 2020/08/10 10:54:11 Using cache file /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/cache.json
[slack] 2020/08/10 10:54:11 Using emoji dir /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/emoji
[slack] 2020/08/10 10:54:11 loaded config: {redacted}
[slack] 2020/08/10 10:54:11 loaded cache
[alfred] 2020/08/10 10:54:11 set keyword to 'users'
[alfred] 2020/08/10 10:54:11 tell: data=alfred.workflowData{Keyword:"users", Mode:"tell", Mod:"", Data:""}, arg=''
[alfred] 2020/08/10 10:54:11 Skipping disabled command 'token'
[alfred] 2020/08/10 10:54:11 Adding items for 'users'
[slack] 2020/08/10 10:54:11 Refreshing cache...
[slack] 2020/08/10 10:54:11 GETing from URL: https://api.slack.com/api/auth.test?token=redacted
[slack] 2020/08/10 10:54:11 GETing from URL: https://api.slack.com/api/channels.list?exclude_archived=1&token=redacted
[slack] 2020/08/10 10:54:11 GETing from URL: https://api.slack.com/api/emoji.list?token=redacted
[slack] 2020/08/10 10:54:11 GETing from URL: https://api.slack.com/api/users.list?token=redacted
[slack] 2020/08/10 10:54:12 Got auth
[slack] 2020/08/10 10:54:12 Got emoji
[slack] 2020/08/10 10:54:12 Got channels
[alfred] 2020/08/10 10:54:12 Saving JSON to /Users/bod/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.jason0x43.alfred-slack/cache.json
[alfred] 2020/08/10 10:54:12 loaded cache
[10:54:12.462] Slack[Script Filter] {"items":[{"title":"No results","arg":"{}","valid":false}]}

If I curl https://api.slack.com/api/users.list?token=mytoken, I get what seems to be a valid results.

Any idea?

If I can help troubleshoot don't hesitate to tell me how :)