slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
155 stars 27 forks source link

[BUG] no-permission for collaborators #266

Closed spoike closed 7 months ago

spoike commented 7 months ago

The deno-slack versions

"deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.5.0/",
"deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.2/",

Deno runtime version

deno 1.37.2 (release, x86_64-apple-darwin) v8 11.8.172.13 typescript 5.2.2

OS info

ProductName: macOS ProductVersion: 14.2.1 BuildVersion: 23C71

Describe the bug

New users can't collaborate on an app even when they're added as collaborator through the slack CLI. According to the "Team collaboration" docs they should be able to do so.

The docs mention that there should be a third local app for the new user (i.e. "Luke" in the docs). It does not mention however how this third local app is created.

In our case the new user is in the same workspace as the original owner of the app and they are able to run slack deploy to deploy to the production app without any errors. They can't however run their own local development. Note if this matters: our domain requires approval by IT for creating new apps.

Steps to reproduce

  1. Create an app, have it deployed for several days, work on local
  2. New user clones the app's git repository, installs slack cli and deno, authenticates.
  3. Owner adds user with correct user id with slack collaborator add {the new user's user id here}.
  4. Owner runs slack deploy.
  5. New user runs slack run.

Expected result

New user should be able to run local development of that app.

Actual result

New user can't run the app locally and gets a no-permission error.

filmaj commented 7 months ago

Can you post the debug logs of the collaborator from the CLI ? You can also run the CLI commands with --verbose and paste the output. I'm interested to see which HTTP API of Slack's is returning no-permission.

spoike commented 7 months ago

My collaborator was messing around and we found out that the presence of an apps.dev.json (that isn't git ignored) hinders the slack CLI to install a new app instance for the collaborator.

Looks like you have to delete it and do a slack install for the collaborator.

filmaj commented 7 months ago

@spoike the contents of apps.dev.json lists out app and workspace IDs that local-run apps are currently installed to. It is worth noting that local-run apps are per-developer - they should not be shared. If multiple collaborators are sharing an apps.dev.json, indeed that would cause permission issues (as the local-run app is implicitly owned by the developer who runs the slack run command). This is why all of our sample applications have the apps.dev.json added to .gitignore.

spoike commented 7 months ago

Yup, it was my mistake somehow that the apps.dev.json file got omitted in .gitignore. Thanks for the help.