`LookupSubjects` seems to be returning
# spicedb
b
LookupSubjects
seems to be returning duplicate results, this is just running tests against the
memory
datastore so not sure if it's datastore-specific. Is this known and/or expected in
1.29.2
?
Copy code
❯ zed relationship create auth/organisation:123 admin auth/staff:abc#user
11:51AM WRN the version of SpiceDB being called is out of date. See: https://github.com/authzed/spicedb/releases/tag/v1.30.1 latest-released-version=v1.30.1 this-version=v1.29.2
GhUKEzE3MTI3OTMwNzM3NTUzNjg3MDY=

❯ zed permission lookup-subjects auth/organisation:123 admin auth/staff#user
auth/staff:abc
auth/staff:abc

❯ zed relationship read auth/organisation:123 admin auth/staff:abc#user
auth/organisation:123 admin auth/staff:abc#user
Just saw https://github.com/advisories/GHSA-j85q-46hg-36p2 but this is slightly different, I don't have a unioned relation and I'm looking up the relation subjects directly, no arrows involved
relation admin: staff#user
I will see if the hotfix fixes it anyway
It did not
j
LS does not filter duplicates
Nor does LR when cursors are used
b
But how is there a duplicate? It's a fresh datastore with only that relation in it. Not a big deal as I can use
ReadRelationships
for my test, just trying to wrap my head around why this happens
j
If there are two schema paths to the same subject, it can show twice
b
I still don't follow how there could be multiple schema paths to the subject in this case
Copy code
❯ zed schema read
definition auth/organisation {
    relation admin: auth/staff#user
}

definition auth/staff {
    relation user: auth/user
}

definition auth/user {}

❯ zed relationship create auth/organisation:123 admin auth/staff:abc#user
GhUKEzE3MTI3OTkwMzk2MDIzMjA3MTg=

❯ zed permission lookup-subjects auth/organisation:123 admin auth/staff#user
auth/staff:abc
auth/staff:abc
j
Because it’s dispatching to itself
So it’s returning twice
b
Ahhh
j
You just hit a corner case
We could filter that, I suppose
b
It's probably not something I'd ever use in reality, it doesn't manifest the same if I add a
user
relation to
staff:123
and lookup the
user
subjects instead. I was specifically trying to test for the relation being created without caring about whatever else existed - in hindsight
ReadRelationships
is a better choice for this anyway