Incorrect relation matching when using custom ID field

Hi there,

I’m experiencing an issue with the Fibery Integration API where entities are being linked incorrectly despite sending correct data. Not sure if this is an API issue or if I just didn’t quite understand how the intended usage is.

Setup:

  • We’re syncing data from an external system (Jira Assets) to Fibery
  • Using the /api/v1/synchronizer/data endpoint with synchronizationType: 'full'
  • Entities have a custom id field (using keys like “ES-123”, “ES-456”) instead of UUIDs
  • Relations are configured with targetFieldId: 'id' to match against this custom field

The Problem:
When syncing a “Measure” entity (let’s call it “M-1312”) that should only be linked to one “School” entity (“S-49”), Fibery is incorrectly linking it to multiple schools (both “S-4” and “S-49”).

What we’re sending:

{
  "id": "M-1312",
  "name": "Measure 1312",
  "schulen": ["S-49"]
}

Target entities in Fibery:

// School S-4
{
  "id": "S-4",
  "name": "School 4"
}

// School S-49  
{
  "id": "S-49",
  "name": "School 49"
}

Expected behavior:
M-1312 should only be linked to S-49 (since schulen only contains ["S-49"] and the relation uses targetFieldId: 'id' for exact matching).

Actual behavior:
M-1312 is linked to BOTH S-4 and S-49.

Schema configuration:

"schulen": {
  "type": "array[text]",
  "relation": {
    "cardinality": "many-to-many",
    "targetType": "school",
    "targetFieldId": "id"
  }
}

Questions:

  1. Does Fibery perform any fuzzy matching on the id field (e.g., prefix matching)?
  2. Should the id field be of a specific format?
  3. Is there a known issue with using non-UUID values in the id field for relation matching?

Any insights would be appreciated!

Alex

Fibery uses contains for matching, so indeed, if you are matching on ‘S-49’ then both ‘S-49’ and ‘S-4’ will be linked.
I’d suggest doing some kind of hashing or string wrapping of the values prior to matching, so that you can avoid this.

Thanks a lot for your quick reply! I will create a UUID and use that.

From an implementation perspective it really does not matter, but I don’t find it obvious that you use contains to match two IDs. If you have the option, perhaps add a note to your documentation :wink:

Alex