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

Address Review always adds a new address #3784

Closed
spencern opened this Issue Feb 17, 2018 · 1 comment

Comments

3 participants
@spencern
Copy link
Member

spencern commented Feb 17, 2018

Summary

The Address review step that's used by the Avalara tax package to verify addresses creates a new address every time. If a user is editing an existing address this causes problems because it creates a duplicate address.

Expected behavior

When editing an address, the address review step should update the existing address.

Actual behavior

When editing an address, the address review step creates a new address

It seems that this has been an issue since the Address Review step was added, as I can't find any evidence that we've ever had a conditional to update the address instead of adding another.

Here's the code where this seems to have been created: https://github.com/reactioncommerce/reaction/pull/2162/files#diff-d911c0fbda71d12469950456914e264aR88 and as you can see it's always calling addressBookAdd unlike the submit for the addressBookEditForm which will call accounts/addressBookUpdate as seen here: https://github.com/reactioncommerce/reaction/blob/release-1.8.0/imports/plugins/core/accounts/client/templates/addressBook/edit/edit.js#L74

Steps to reproduce the behavior

  1. Enable Avalara w/ valid credentials
  2. Enable Shippo and Flat Tax rates
  3. As an anonymous user, add a product to your cart and proceed to checkout.
  4. Enter an address and approve it's validation
  5. Click the edit "pencil" icon for that address and then click save without making any changes
  6. Approve the address validation
  7. Observe that the address is now duplicated

** Note that there's another bug which will prevent you from even getting past the validation approval step. This PR seems to resolve that for me, so until it's merged you may need to manually resolve that issue.

Versions

Node: 8.9.0
NPM: 5.6.0
Meteor Node: 8.9.4
Meteor NPM: 5.6.0
Reaction CLI: 0.27.0
Reaction: 1.8.0
Reaction branch: release-1.8.0
Docker: 17.12.0-ce
@zenweasel

This comment has been minimized.

Copy link
Member

zenweasel commented Feb 17, 2018

@spencern Did you mean Flat Tax or Flat Rate shipping in the repro steps?

@Akarshit Akarshit self-assigned this Feb 19, 2018

aaronjudd pushed a commit that referenced this issue Feb 21, 2018

Aaron Judd
Merge pull request #3788 from reactioncommerce/fix-3784-akarshit-dupl…
…icate-address

Fixes #3784: Edit address when already present

@spencern spencern referenced this issue Feb 22, 2018

Merged

Release 1.8.0 #3645

@Akarshit Akarshit closed this Feb 22, 2018

@spencern spencern referenced this issue Mar 9, 2018

Merged

Release 1.9.0 #3941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.