Back

User with session cannot execute function with "Users" execute permissions right after signing in

  • 2
  • Functions
obiwanzenobi
16 Sep, 2023, 17:52

At least 500ms

TL;DR
User is facing a problem where they cannot execute a function with "Users" execute permissions right after signing in. They discovered that the issue was caused by not having the appwrite SDK clients as singletons and having multiple cookie jars. The user is still trying to find the source of the bug. No solution is provided in the thread.
Drake
16 Sep, 2023, 17:52

Lol that's not even bad πŸ˜…

Drake
16 Sep, 2023, 18:28

The only way might be to prevent it from being stopped due to inactivity

obiwanzenobi
20 Sep, 2023, 20:43

I feel like this problem is even more frequent in 1.4.3

obiwanzenobi
20 Sep, 2023, 20:47

redacted version of client logs:

obiwanzenobi
20 Sep, 2023, 20:47
obiwanzenobi
20 Sep, 2023, 20:48

document not found because of permissions

obiwanzenobi
20 Sep, 2023, 20:51

tl;dr;

obiwanzenobi
20 Sep, 2023, 20:51

there is a 4 requests

obiwanzenobi
20 Sep, 2023, 20:52

first that creates email session

obiwanzenobi
20 Sep, 2023, 20:52

second for retrieving account data

obiwanzenobi
20 Sep, 2023, 20:52

third that gets data from database

obiwanzenobi
20 Sep, 2023, 20:53

and the last that get sessions

obiwanzenobi
20 Sep, 2023, 20:53

cookie saved after first request is only used in second request, but not in third

Drake
20 Sep, 2023, 22:59

sorry i think i misunderstand your problem originally

Drake
20 Sep, 2023, 22:59

i don't understand this πŸ˜…

can you share your code?

Drake
20 Sep, 2023, 23:01
obiwanzenobi
20 Sep, 2023, 23:04

I see, so yea this is true - session mechanism in Flutter SDK is not working correctly

obiwanzenobi
20 Sep, 2023, 23:05

but I'm still looking for a source of this bug

Drake
20 Sep, 2023, 23:06

can you share your client code?

obiwanzenobi
20 Sep, 2023, 23:15

not really - its a production code, I will try to prepare something simpler but what I found for now if you init SDK not being authenticated - you can authorize and right after call database without problems if you init SDK while being authenticated - you cannot call database again after logging out and logging in

obiwanzenobi
21 Sep, 2023, 00:18

ok, I found it - problem was on our software side

obiwanzenobi
21 Sep, 2023, 00:18

multiple cookie jars

Drake
21 Sep, 2023, 00:25

are you doing something special to the SDK with respect to the cookie jar? 🧐

obiwanzenobi
21 Sep, 2023, 07:55

that was one of the most basic problems tbh πŸ˜„ in one of our projects we forgot to have appwrite sdk clients as singletons so there were more than 1 client

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more