SuperGoodSoft / solidus_taxjar

Support for using TaxJar to handle tax calculations in Solidus
BSD 3-Clause "New" or "Revised" License
12 stars 12 forks source link

Handle updates to orders that have not been reported #217

Closed nvandoorn closed 1 year ago

nvandoorn commented 1 year ago

What is the goal of this PR?

To gracefully handle updates to orders that were never reported at time of purchase.

How do you manually test these changes? (if applicable)

  1. Ensure reporting is disabled
  2. Complete an order
  3. Enable reporting
  4. Issue a refund (or some other change that fires order_recalculated)
  5. Verify the order is not reported
  6. Verify there is a sync log with an error

Merge Checklist

Noah-Silvera commented 1 year ago

Cleaned up the commits, updated the changelog, this is ready to go!

forkata commented 1 year ago

@nvandoorn and I did a deep dive on the spec failures and it looks like something in Solidus 3.2 changed which results in our spec setup enqueueing a ReplaceTransactionJob. It's possible that we just need to reset the job queue between specs so there is no leakage, but for now we've fixed the failures by just ensuring that calling the subject doesn't change the count.