Jump to content

Using `session.ensure` on a Metadata entity will throw a Duplicate Entry error


jen_at_haverstack

Recommended Posts

It's my understanding that using the following code should always return the same metadata entity:

const metadata = await session.ensure(
  'Metadata', {parent_id: "7bd2c20a-f7a1-11ea-8466-005056829324", key: "builds", parent_type: "Breakdown"}
);

If the entity did not exist before, `session.ensure` would create it, and if it did exist it would simply return the existing entity. Instead, if the entity already exists this will throw a Duplicate Entry error.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...