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 saveUnknown work recursively #522

Merged
merged 4 commits into from
Jan 3, 2019
Merged

Make saveUnknown work recursively #522

merged 4 commits into from
Jan 3, 2019

Conversation

dobrynin
Copy link
Contributor

Summary:

When fetching from DynamoDB with saveUnkown === true, nested fields do not get returned. This PR aims to fix that.

GitHub linked issue:

Closes #323

Type (select 1):

  • Bug fix
  • Feature implementation
  • Documentation improvement
  • Testing improvement
  • Test added to report bug (GitHub issue #--- @---)
  • Something not listed here

Is this a breaking change? (select 1):

  • 🚨 YES 🚨
  • No
  • I'm not sure

Is this ready to be merged into Dynamoose? (select 1):

  • Yes
  • No

Are all the tests currently passing on this PR? (select 1):

  • Yes
  • No

Other:

  • I have searched through the GitHub pull requests to ensure this PR has not already been submitted
  • I have updated the Dynamoose documentation (if required) given the changes I made
  • I have added/updated the Dynamoose test cases (if required) given the changes I made
  • I have run npm test from the root of the project directory to ensure all tests continue to pass
  • I agree that all changes made in this pull request may be distributed and are made available in accordance with the Dynamoose license
  • All of my commits and commit messages are detailed, explain what changes were made, and are easy to follow and understand
  • I have confirmed that all my code changes are indented properly using 2 spaces
  • I have filled out all fields above

@coveralls
Copy link

Pull Request Test Coverage Report for Build 818

  • 10 of 12 (83.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 85.504%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/Attribute.js 9 11 81.82%
Totals Coverage Status
Change from base Build 810: -0.003%
Covered Lines: 2188
Relevant Lines: 2482

💛 - Coveralls

@coveralls
Copy link

coveralls commented Dec 31, 2018

Pull Request Test Coverage Report for Build 823

  • 12 of 12 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 85.479%

Totals Coverage Status
Change from base Build 810: -0.03%
Covered Lines: 2188
Relevant Lines: 2482

💛 - Coveralls

@dobrynin
Copy link
Contributor Author

dobrynin commented Jan 1, 2019

I would also like to add an option to errorIfFetchingUnknownAttribute or something to that effect. Any thoughts on this?

Copy link
Member

@fishcharlie fishcharlie left a comment

Choose a reason for hiding this comment

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

Looks good at first glance. We for sure need tests for this. I'd also like to see some more comments explaining a bit more what exactly this is doing, just to make it easier for future devs to work on it.

lib/Attribute.js Outdated Show resolved Hide resolved
lib/Attribute.js Outdated Show resolved Hide resolved
@fishcharlie
Copy link
Member

@dobrynin #522 (comment)

I would also like to add an option to errorIfFetchingUnknownAttribute or something to that effect. Any thoughts on this?

I'm all for that, so long as the default stays as the current behavior (no breaking change). It also probably makes sense to have that be a separate PR.

@dobrynin
Copy link
Contributor Author

dobrynin commented Jan 2, 2019

@fishcharlie, I've added your requested changes. As for making a new PR for errorIfFetchingUnknownAttribute, what's the best way to do that? Wait for this to be merged? Branch off of this branch?

@fishcharlie fishcharlie mentioned this pull request Jan 3, 2019
Copy link
Member

@fishcharlie fishcharlie left a comment

Choose a reason for hiding this comment

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

LGTM

@fishcharlie fishcharlie merged commit bd0a733 into dynamoose:master Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maps Nested unknown attributes not set when saveUnknown is true
3 participants