Ensure domain_filter is honored prior to saving the data #2401
Labels
discussion required
requires a discussion before moving forward
investigation required
Requires some initial investigation
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
: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 thestructure_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
. Soit 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.The text was updated successfully, but these errors were encountered: