slack-ruby / slack-ruby/slack-ruby-client
invalid_array_arg with users_profile_set when profile is not JSON
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.3k
- Forks
- 222
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
I'm trying to create a small integration that changes the user status, and am unable to do so. No matter what permutation of users_profile_set I choose, I cannot get around an invalid_array_arg error from slack.
client.users_profile_set(
user: user_id,
profile: {
:status_text=>"anything",
:status_emoji=>":house_with_garden:",
:status_timeout => 1234
})
I'm positive that the User ID is correct. I can actually use this method to set an individual property, but setting the emoji property clears the status property, and vice versa. Anything involving using the "profile" hash causes the problem
Full Error:
Slack::Web::Api::Errors::SlackError: invalid_array_arg
from /Users/jon/.rvm/gems/ruby-2.3.3/gems/slack-ruby-client-0.14.1/lib/slack/web/faraday/response/raise_error.rb:11:in 'on_complete'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with users_profile_set and the error path at lib/slack/web/faraday/response/raise_error.rb:11, then reproduce the reported profile-hash request using the status_text, status_emoji, and status_timeout values shown. Compare it with setting each property individually; done means the profile hash request is accepted and setting one status field no longer clears the other.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100