clerk / clerk/clerk-sdk-ruby

Clerk::Proxy.organization bug

Open Beginner friendly
#142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
32
Forks
19
Avg merge
19h 27m
Merged PRs (30d)
1

Description

the call to the Clerk::Proxy organization method fails due to an argument mismatch.

Refer to the following error output:

[12] pry(#<Router>)> env["clerk"].organization
ArgumentError: missing keyword: :organization_id (ArgumentError)

    caller: .../ruby/gems/4.0.0/gems/clerk-sdk-ruby-8.0.0/lib/clerk/proxy.rb:133
    |         sdk.organizations.get(org_id: org_id).organization
                               ^^^^
    callee: .../ruby/gems/4.0.0/gems/clerk-sdk-ruby-8.0.0/lib/clerk/organizations.rb:341
    |     def get(organization_id:, include_members_count: nil, include_missing_member_with_elevated_permissions: nil, retrie...
              ^^^
from .../ruby/gems/4.0.0/gems/clerk-sdk-ruby-8.0.0/lib/clerk/organizations.rb:341:in 'Clerk::Organizations#get'

https://github.com/clerk/clerk-sdk-ruby/blob/cc37e0a45a1f63bcd0077eb39efd1564321e06b6/lib/clerk/proxy.rb#L133
^ The above line calls the get method with the org_id keyword, when it actually requires organization_id instead.
https://github.com/clerk/clerk-sdk-ruby/blob/cc37e0a45a1f63bcd0077eb39efd1564321e06b6/lib/clerk/organizations.rb#L341

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 in lib/clerk/proxy.rb around line 133 and compare the organization call with the get method signature in lib/clerk/organizations.rb around line 341. Confirm that the organization lookup uses the keyword expected by that method, then verify that env["clerk"].organization no longer raises the reported ArgumentError.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
authentication
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.