Aidbox/Issues

[BUG] Can't set isUnique restriction to attribute on an entity using NodeJS SDK

Closed this issue · 3 comments

Describe the bug
When using NodeSDK I can't create an entity with a unique attribute.

Severity
Major

Steps to reproduce the behavior:

  1. Create an AidboxApp with the next entity:
const Entity = {
  attrs: {
    adtRecordId: {
      type: 'id',
      unique: true
    }
  }
};

or

const Entity = {
  attrs: {
    adtRecordId: {
      type: 'id',
      isUnique: true
    }
  }
};

Expected behavior
It should create an entity with an adtRecordId attribute that has the isUnique: true restriction.

Screenshots
I receive this error when I try to do that: (Used the same request via POSTMAN on the [PUT] /APP endpoint with the same schema)

image

{
    "resourceType": "OperationOutcome",
    "id": "invalid",
    "text": {
        "status": "generated",
        "div": "Cannot save manifest because of errors: [{:path [:entities :Entity :attrs :adtRecordId :isUnique], :message \"extra property\"}]"
    },
    "issue": [
        {
            "severity": "fatal",
            "code": "invalid",
            "diagnostics": "Cannot save manifest because of errors: [{:path [:entities :Entity :attrs :adtRecordId :isUnique], :message \"extra property\"}]"
        }
    ]
}

Also the error in the app console:
image

Versions:

  • Aidbox image version:
    devbox:stable v:2205.0f45af30

Additional context
I can do this via the REST API setting isUnique: true in the entity but when I reload the app the entity is overwritten and the attribute no longer has that restriction.

Hi, thank you for reporting the issue. Bug is confirmed, estimated fix delivery time is Aug, 9

@ArmellaJuan, hi. We fixed your issue, it's available on :edge. Please pull new version and let us know if it's working for you.

Cool after switching to that image seems working:

      type: 'id',
      isUnique: true
    },

And in devbox:
Screen Shot 2022-08-09 at 10 10 22 AM

Thanks!