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

Make app robust to scsb api issues #384

Merged
merged 1 commit into from
May 24, 2024
Merged

Make app robust to scsb api issues #384

merged 1 commit into from
May 24, 2024

Conversation

nonword
Copy link
Member

@nonword nonword commented May 8, 2024

Ensure that, if connecting to the SCSB API raises an error or responds unexpectedly when querying for item statuses, we set offsite item statuses to 'Not available' and proceed with other work.

Includes light refactoring to improve readability

https://jira.nypl.org/browse/SCC-4050

Ensure that, if connecting to the SCSB API raises an error or responds
unexpectedly when querying for item statuses, we set offsite item statuses to
'Not available' and proceed with other work.

Includes light refactoring to improve readability

https://jira.nypl.org/browse/SCC-4050
@nonword nonword requested a review from charmingduchess May 8, 2024 18:06

if (!Array.isArray(itemsStatus)) {
logger.warn(`Got bad itemAvailabilityStatus response from SCSB for barcodes (${barcodes}): ${JSON.stringify(itemsStatus)}`)
return {}
Copy link
Member Author

Choose a reason for hiding this comment

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

The validation and early return {} instances are the main functional change here. They ensure that, if anything unexpected happens in the scsb call, the barcode-to-status mapping is returned as {}, causing ReCAP items to default to na status.

@nonword nonword requested a review from danamansana May 10, 2024 20:51
@nonword nonword merged commit e6bcc96 into qa-node20 May 24, 2024
2 checks passed
@nonword nonword deleted the scc-4050 branch May 24, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants