informatics-isi-edu / ermrestjs

ERMrest client library in JavaScript
Apache License 2.0
4 stars 3 forks source link

Improve the duplicate detection for entity all-outbound paths #983

Open RFSH opened 1 year ago

RFSH commented 1 year ago

When we're fetching values for a table, we're also adding all the all-outbound paths that the page needs to the same request. This list is computed as part of the Reference.activeList API. In this API, we go over all the different ways that an all-outbound path might be needed (visible columns, wait_for of visible columns, and fkeys in the source-definition).

To ensure we're not adding duplicate join statements, we're adding each unique path only once. This uniqueness check is done by checking the name property, which is populated based on the whole path, including the last column. But the last column doesn't affect the generated request in' entity' paths, so we should only look for the foreign key hops in this case.