Skip to content

stub_response regression in aws-sdk-core >= 3.221.0 with quicksight sdk #3229

@fcheung

Description

@fcheung

Describe the bug

With aws-sdk-core versions >= 3.221, calling a method on Aws::Quicksight::Client stubbed with stub_responses returns nil instead of the configured value

Regression Issue

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

Expected Behavior

When calling the stubbed method I should get the stub data I provided, not nil. This is the observed behaviour with versions <= 3.220

Current Behavior

The reproduction below evaluates to nil when run against '3.221.0' (it's not really nil, but a Seahorse::Client::Response, whose getobj returns nil).

Reproduction Steps

gem 'aws-sdk-quicksight', '1.144.0'
gem 'aws-sdk-core', '3.221.0'

require 'aws-sdk-quicksight'
client = Aws::QuickSight::Client.new stub_responses: true
data = client.stub_data(:generate_embed_url_for_registered_user, embed_url: "http://example.com")

client.stub_responses(:generate_embed_url_for_registered_user, data)

puts client.generate_embed_url_for_registered_user(
user_arn: 'some-arn',
aws_account_id: '112233445566',
experience_configuration: {dashboard: {initial_dashboard_id: 'abc'}},
)

Possible Solution

No response

Additional Information/Context

The stubbed data looks like

#<struct Aws::QuickSight::Types::GenerateEmbedUrlForRegisteredUserResponse embed_url="http://example.com", status=0, request_id="String">

If I set status to 200 then when I call client.generate_embed_url_for_registered_user I get the expected result. At a guess the status of 0 causes

response.on(200..299) { |resp| Response::Parser.new.apply(resp) }
to not apply the stub body to the result.

From the description it sounds like #3204 might be relevant, but not sure what in the diff is the culprit

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

aws-sdk-quicksight=1.144; aws-sdk-core=3.221.0

Environment details (Version of Ruby, OS environment)

ruby 3.4.2 (in the ruby:3.4.2-alpine docker image)

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.potential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions