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

The resulting entity of the awaited #save$ method does not include an id #11

Open
lilsweetcaligula opened this issue May 21, 2021 · 0 comments

Comments

@lilsweetcaligula
Copy link

The resulting entity of the awaited #save$ method does not include an id. It should.

Promisified:

const product = await seneca.make('product')
  .data$({ label: 'Legions of Rome' })
  .save$()

console.log(product)
// outputs: Entity { 'entity$': '-/-/product', label: 'Legions of Rome' }
// the returned entity has no id

Traditional callback-based:

seneca.make('product')
  .data$({ label: 'Legions of Rome' })
  .save$((err, out) => {
    if (err) return done(err)
    console.log(out)
    // outputs: Entity {  'entity$': '-/-/product',  label: 'Legions of Rome',  id: 'j0s5rs' }
    // the returned entity has the id
    return done()
  })

The bug has been first observed during writing of automated tests in the mem-store.

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

No branches or pull requests

1 participant