edgedb-ui
edgedb-ui copied to clipboard
UI fails to show data if there are items with empty links inside `assert_exists()`
Example schema:
module default {
type A {
multi b: B { constrain exclusive; on source delete delete target; };
}
type B {
required single link a := assert_exists(.<b[is A])
}
}
Then run query insert B {} or insert item B manually in UI and navigate to table B. UI will show error Failed to fetch data and will fail to show any data. Error in console CardinalityViolationError: assert_exists violation: expression returned an empty set
This seems like correct behavior. Maybe you'd want the error message in the UI instead of Failed to fetch data
This seems like correct behavior. Maybe you'd want the error message in the UI instead of
Failed to fetch data
I belive it should show entities that don't violate constraint
Data is broken at the schema level though - wouldn't you receive the same error making an equivalent query in the CLI?
Data is broken at the schema level though - wouldn't you receive the same error making an equivalent query in the CLI?
In CLI it's unlikely to select all items at once
I often try to use UI to investigate problem. I believe a good way to do this is to show normal items and then section with broken. And Ability to load them without causing issues properties
I'll look into fixing/improving this, but the fix will likely be just detecting the error and then disabling fetching data for the offending column, similar to how access policy errors are handled. Since multiple rows of data are fetched at a time, unfortunately I don't think it's currently possible to exclude just the broken row.