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

API-45450-bug-fix-request-index #21103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rockwellwindsor-va
Copy link
Contributor

Summary

  • When page size is set to 1 BGS returns an object, not an array of obects and so calling .pluck to get the procID was breaking. This fix is designed to mae sure that value coming back is always an array

Related issue(s)

API-45450

Testing done

  • New code is covered by unit tests

Screenshots

Note: Optional

What areas of the site does it impact?

modified:   modules/claims_api/app/services/claims_api/power_of_attorney_request_service/index.rb
new file:   modules/claims_api/spec/services/power_of_attorney_request_service/index_spec.rb

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

* When the page size param is 1 BGS returns and object not an array.  This updates to always return an array from that call

	modified:   modules/claims_api/app/services/claims_api/power_of_attorney_request_service/index.rb
	new file:   modules/claims_api/spec/services/power_of_attorney_request_service/index_spec.rb
@rockwellwindsor-va rockwellwindsor-va added the claimsApi modules/claims_api label Mar 5, 2025
@va-vfs-bot va-vfs-bot temporarily deployed to API-45450-bug-fix-request-index/main/main March 5, 2025 17:50 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review March 5, 2025 20:09
@rockwellwindsor-va rockwellwindsor-va requested a review from a team as a code owner March 5, 2025 20:09
it 'does not return an error when page_size is 1' do
expect do
subject.get_poa_list
end.not_to raise_error(TypeError)
Copy link
Contributor

@cilestin cilestin Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the specific type check (in both places). We don't care what kind of error was being thrown, we need to ensure sure it doesn't throw errors at all; doing so means that this won't blindly go green if some edit in the future throws a NoMethodError or the like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do,
bb6c77e


context 'when page size is over 1 and less then the max allowed' do
before do
@page_size = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not over 1. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimsApi modules/claims_api test-failure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants