Cannot get user name and email in background task

I need to retrieve user email in a background task, and it seems impossible. Specifically, when I call anvil.users.get_user() in a background task it’d return None, whereas it would not be the case in a callable task. Why is it the case?

Here’s a simple app to demonstrate that:
https://anvil.works/build#clone:K3MXA3K4PFBKNLVI=3REIVRUAW4CE7EJAUXQ724CG

Looks like you’re running into this issue: Users.get_user() returns None in freshly launched background tasks - #6

2 Likes

thanks for the rapid response!