fix(explorer): Refresh s3 node on profile switch (#7401, #7665) #7932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When a connection is changed, the awsClientBuilderV3 is used to get the service details, and a cache is being used to cache the service. However, in the cache key only region is cached along with other service details, so on profile switch it is still returning the same cached service of previous profile.
Solution
Retrieved current profile using global aws context, and added it to the cache key, so when profile is switched, cache is updated and service from new profile is retrieved.
This approach resolves the node refresh issue by including the profile in the cache key. I'd appreciate feedback on whether there are any edge cases or alternative approaches I should consider.
I'm also looking for guidance on writing tests for this change. What would be the recommended approach for writing unit/integration tests to verify profile switches?
Thank you.
feature/x
branches will not be squash-merged at release time.