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

Unhelpful error message when using rewrites as the base (tupleset) of a from #68

Open
rhamzeh opened this issue Sep 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@rhamzeh
Copy link
Member

rhamzeh commented Sep 20, 2023

model
  schema 1.1
type user
type org
  relations
    define owner: [user]
    define member: [user]
    define can_add_member: owner
type team
  relations
    define parent: [org]
    define member: [user]
    define can_add_member: can_add_member from parent
type group
  relations
    define parent: [team]
    define org: parent from parent
    define member: [user]
    define can_add_member: can_add_member from org

The language server shows an unhelpful ModelValidationError:

`can_add_member` is an impossible relation for `group` (no entrypoint).

The actual error should inform the user the because group -> org has a rewrite (in this case tuple to userset, but computed usersets or a type restriction with a userset should also fail), it cannot be used as the source of a from (cannot be used as a tupleset).

The actual error message should be discussed.

The API shows a much more helpful message in similar situations:

the 'group#org' relation is referenced in at least one tupleset and thus must be a direct relation
Screenshot 2023-09-20 at 6 40 51 PM
@rhamzeh rhamzeh added the bug Something isn't working label Sep 20, 2023
@rhamzeh rhamzeh changed the title Calling Unhelpful error message when using rewrites as the base (tupleset) of a from Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant