checkout-sdk-js: Unexpected state values returned from service.signInCustomer

Running this piece of code:

import {createCheckoutService} from '@bigcommerce/checkout-sdk'
const service = createCheckoutService()
service.loadCheckout().then(() => {
  service.signInCustomer({
    email: 'test@test.com',
    password: 'test',
  }).then((state) => console.log(state.data.getCustomer()))
})

Logs:

{
  "id": 0,
  "isGuest": true,
  "email": "",
  "firstName": "",
  "lastName": "",
  "fullName": "",
  "addresses": [],
  "storeCredit": 0
}

Am I missing something here?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Sorry everyone, I just had a chance to look at this issue. It seems stencil-cli caches all HTTP responses and uses the cache if the same GET request is made in the last 15 seconds. The logic doesn’t look right to me as it doesn’t seem to honour the cache-control header of the responses. Anyway, before we can put in a fix in, I think the current workaround for this issue to run CLI with the caching option turned off. i.e.: stencil start --no-cache. Please let me know if this helps. Thanks!

cc @ankurbigcomm

Thanks for the detailed information. By checking the SDK it looks like the 2 request should happen in series, I’m not sure what’s going on. We’ll try to replicate it and see if we can spot the issue.