hmm i got the exact same reults by introducing a n...
# spicedb
c
hmm i got the exact same reults by introducing a new relation and looking up subjects of that relation as i got with my initial attempt. i.e the array contained the same id twice 🤔 I could of course eliminate duplicates from the query response but something is wrong 🤔 I'm having this flow
Copy code
typescript
function spiceDbUpsertPromptRelations(prompt: UpsertPromptServiceInput, context: UserContext, promptId: string) {
  return setCreator(promptId, context)
    .andThen(() => getViewers(promptId))
    .andThrough((userViewers) => updatePromptMembers(prompt, promptId, userViewers))
    .andThen(() => getGroupViewers(promptId))
    .andThrough((groupMemberViewers) => updatePromptGroups(prompt, promptId, groupMemberViewers))
    .andThen(() => ok({ id: promptId }));
}
i have one step where i update the members and one step where i update the groups. They are basically duplicates and
getViewers
and
updatePromptMembers
work as expected
3 Views