Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dancastellon
Copy link
Contributor

Resolves #4968
Impact: minor
Type: bugfix

Issue

When updating an address via the updateAccountAddressBookEntry, the Accounts record's updatedAt field is updated. This isn't happening when adding an address via the addAccountAddressBookEntry mutation.

Solution

The solution is to set updatedAt to the current date when adding the address. After discussing with @aldeed, I also removed logic that added the address as the only address in the matching users collection record, and logic that set the name on the address as the account's name. From Eric:

I’d actually prefer to stop storing most things, including addresses, in the users collection since we use Accounts collection for all of that. We should be gradually reducing users to being only IDP data since we hope to eventually stop using Meteor for identity.

I’d like to get rid of auto-updating the name, too. It’s always been weird that we do that since the name they put on the address might not even be their name

Breaking changes

None

Testing

  1. Add an address to your account. In Starterkit, you can do that with this PR
  2. Confirm the address is still added to Accounts.addressBook[] and Accounts.updatedAt is updated

@dancastellon dancastellon requested review from aldeed and nnnnat February 7, 2019 22:23
Copy link
Contributor

@aldeed aldeed left a comment

Choose a reason for hiding this comment

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

@dancastellon You need to rebase to sign your commits but other than that 👍 from me

Copy link
Contributor

@nnnnat nnnnat 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. @dancastellon once you sign your commits I'll merge

@dancastellon dancastellon force-pushed the fix-4968-dancastellon-addressBookAdd-updatedAt branch from 82f3656 to a670e26 Compare February 8, 2019 20:03
… don't store address name under account + don't save address to users collection

Signed-off-by: Daniel Castellon <[email protected]>
Signed-off-by: Daniel Castellon <[email protected]>
@dancastellon dancastellon force-pushed the fix-4968-dancastellon-addressBookAdd-updatedAt branch from a670e26 to 51668b5 Compare February 8, 2019 20:08
@nnnnat nnnnat merged commit ca49b2b into develop Feb 11, 2019
@nnnnat nnnnat deleted the fix-4968-dancastellon-addressBookAdd-updatedAt branch February 11, 2019 18:31
@jeffcorpuz jeffcorpuz mentioned this pull request Mar 1, 2019
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