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: add null check to prevent API response errors (issue #13941) #378

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

vaisshnavi7
Copy link
Contributor

@vaisshnavi7 vaisshnavi7 commented Oct 28, 2024

Issue #, if available: aws-amplify/amplify-js#13941 (comment)

Description of changes: This PR adds a null check to prevent potential errors in API response handling. The following changes have been made:

  1. Implemented a null check in indexQuery.ts to handle cases where the API response data might be null.
  2. Updated secondary-indexes.ts test to ensure that null data responses do not cause exceptions.
  3. The changes affect the following packages:
    • integration-tests
    • data-schema

Validation: I reproduced the issue by simulating null data scenarios in the local environment, including cases with empty API responses. After applying the fix, I reran the integration tests and confirmed that the null data no longer caused errors.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@vaisshnavi7 vaisshnavi7 requested review from a team as code owners October 28, 2024 20:28
Copy link

changeset-bot bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 672ea2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
integration-tests Patch
@aws-amplify/data-schema Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@stocaaro stocaaro left a comment

Choose a reason for hiding this comment

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

Overall, this change looks good and makes sense. Two things.

  1. Can the title of this change be made following the conventional commit format so that when we squash the change the commit message to the main repo will be conventional.
  2. How was this change validated? Want to make sure we reproduced the error case and confirmed this fix with some level of validation documention added the the description before this gets merged.

@vaisshnavi7 vaisshnavi7 changed the title Bug fix/issue 13941 null check Fix for Issue #13941: Added Null Check Oct 28, 2024
@vaisshnavi7 vaisshnavi7 changed the title Fix for Issue #13941: Added Null Check fix: add null check to prevent API response errors (issue #13941) Oct 28, 2024
@vaisshnavi7 vaisshnavi7 enabled auto-merge (squash) October 31, 2024 17:11
@vaisshnavi7 vaisshnavi7 merged commit 060a3b6 into main Oct 31, 2024
9 checks passed
@iartemiev iartemiev deleted the bugFix/issue-13941-null-check branch October 31, 2024 17:30
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.

4 participants