https://authzed.com logo
Title
g

Glittering Banano

02/20/2023, 1:30 PM
Hi, I am testing the caveat example given at - https://github.com/authzed/spicedb/blob/main/internal/services/integrationtesting/testconfigs/expiration.yaml I have kept the schema same but have modified the first line of the test relationship from - document:firstdoc#viewer@user:tracy[is_not_expired:{"expiration":"2024-12-01T00:00:00Z","current_time":"2023-01-01T00:00:00Z"}] to - document:firstdoc#viewer@user:tracy[is_not_expired:{"expiration":"2024-12-01T00:00:00Z","current_time":"2025-01-01T00:00:00Z"}] (by changing the current_time's year from 2023 to 2025 to make the caveat's condition current_time < expiration as false.) I still see "tracy" in the expected relations tab when running document:firstdoc#view: []. Is this expected behaviour? Shouldn't tracy be no longer there if the caveat fails?
v

vroldanbet

02/20/2023, 3:41 PM
Hey 👋🏻 I think that is expected, note the
[...]
notation generated, which means "expected with caveat". I could see that being confusing because you've provided the caveat context fully and so the caveat on the relationship could be resolved, so ideally it wouldn't show
[...]
. @Joey can you confirm whether this behaviour in
expected relations
is intentional?
here is the correponding playground link: https://play.authzed.com/s/tzZoRWJCfQjI/expected
j

Joey

02/20/2023, 3:43 PM
expected relationships doesn't resolve caveats
if it is possible it can be returned, it shows
[...]
g

Glittering Banano

02/20/2023, 5:09 PM
Thank you. Request to please mention this in the caveat reference doc.