supabase / supabase-swift

A Swift client for Supabase

Home Page:https://supabase.com/docs/reference/swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Session.User: isAnonymous field missed

ypotsiah opened this issue · comments

Bug report

  • [✔] I confirm this is a bug with Supabase, not with my own application.
  • [✔] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

User's boolean property isAnonymous missed from appropriate client model declaration.

To Reproduce

You can see that is_anonymous field exists in raw server response for session's user but actually is not decoded as part of User's model.

Expected behavior

User model on client side should have isAnonymous boolean field to describe user's state.

System information

supabase-swift - v2.8.0

Additional context

Technically it should be mandatory field but probably it will cause an backward compatibility issue with decoding local stored session after client's upgrade. Making it optional cause another problem - how to qualify user if flag is nil?

Another thoughts here: does it make sense to add it as computed property basing on empty/non-empty linked identities? What are criterias on the server side to mark user as anonymous in database?

@ypotsiah thanks for opening this issue.

For backward compatibility we can check the identities list when decoding the Session object, let me just confirm this with auth team.