slack-ruby / slack-ruby/slack-ruby-client

invalid_array_arg with users_profile_set when profile is not JSON

Open
#258 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.