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

Ensure domain_filter is honored prior to saving the data #2401

Open
RFSH opened this issue Feb 21, 2024 · 0 comments
Open

Ensure domain_filter is honored prior to saving the data #2401

RFSH opened this issue Feb 21, 2024 · 0 comments
Labels
discussion required requires a discussion before moving forward investigation required Requires some initial investigation

Comments

@RFSH
Copy link
Member

RFSH commented Feb 21, 2024

Summary

While we're making sure domain_filter is honored and consistent when users attempt to open the popups, the selected values might not be consistent depending on the order of events.

For instance, assume that we have the following domain_filter:

{
  "tag:isrd.isi.edu,2016:foreign-key": {
    "domain_filter": {
      "ermrest_path_pattern": "structure_id={{{structure_id}}}",
      "pattern_sources": ["structure_id"]
    }
  }
}

The user could first pick a value for this foreign key, and then change the structure_id value. So, in the end, we might save a foreign key value that does not match with the structure_id based.

Details

To solve this, we could do an extra check before sending the request. This check must be done by consulting ermrest and cannot fully be done on the client-side (This requires more thought, but we might at least be able to skip this check if we do some sort of bookkeeping. is this true?).

The goal of the ermrest request is to check whether the selected value in the foreign key input matches the computed ermrest_path_pattern. So
it should be generated by appending the computed ermrest_path_pattern with the shortest key filters.

Before sending the request, we should compute all the domain_filters and see if we can combine the requests and reduce the number of ermrset queries. This requires more investigation

Apart from figuring out the ermrest query, we should also discuss the error message and UI around it. Given that ermerst_path_pattern might be static, we should most probably allow data modelers to skip this extra check. They should also be able to specify whether we should just warn users or throw an error and not allow users to save the data.

@RFSH RFSH added discussion required requires a discussion before moving forward investigation required Requires some initial investigation labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion required requires a discussion before moving forward investigation required Requires some initial investigation
Projects
None yet
Development

No branches or pull requests

1 participant