Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix seahorse client response unused block warning #3169

Closed
1 task
bkuhlmann opened this issue Jan 21, 2025 · 2 comments · Fixed by #3170
Closed
1 task

Fix seahorse client response unused block warning #3169

bkuhlmann opened this issue Jan 21, 2025 · 2 comments · Fixed by #3170
Labels
bug This issue is a bug. investigating Issue is being investigated

Comments

@bkuhlmann
Copy link

Describe the bug

Hello. 👋 I'm getting the following warning in my console:

/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/3.4.0/delegate.rb:84: warning: the block passed to 'Seahorse::Client::Response#__getobj__' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/aws-sdk-core-3.216.0/lib/seahorse/client/response.rb:77 may be ignored

The problem is that a block is being passed to the response when it shouldn't because the response doesn't use a block.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I would expect this error to not show up since the block is never used/implemented in the code.

Current Behavior

Here's what I see locally:

/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/3.4.0/delegate.rb:84: warning: the block passed to 'Seahorse::Client::Response#__getobj__' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/aws-sdk-core-3.216.0/lib/seahorse/client/response.rb:77 may be ignored

Reproduction Steps

I don't have a good way to reproduce this but I imagine if you add this line to your test suite, you'll see the warning show up immediately:

Warning[:strict_unused_block] = true

I see this because when using the gem and having this set in my environment:

export RUBYOPT="-W:strict_unused_block"

...I see the warnings.

Possible Solution

You most likely will see similar warnings in all of your gems since any block passed to a method where the method doesn't use the block with issue this warning.

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-core 3.216.0

Environment details (Version of Ruby, OS environment)

ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin24.2.0]

@bkuhlmann bkuhlmann added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 21, 2025
@jterapin jterapin added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Jan 21, 2025
@jterapin
Copy link
Contributor

Hi! Thank you for submitting the ticket. We'll take a look and get back to you.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating Issue is being investigated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants