# Error: Session state cannot change from

**URL:** <https://forum.social.plus/t/error-session-state-cannot-change-from/657>\
**Category:** Web\
**Created:** [March 1, 2023, 5:34pm UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657 "2023-03-01T17:34:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tech](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tech](https://forum.social.plus/u/Tech)\
**Post date:** [March 1, 2023, 5:34pm UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657/1 "2023-03-01T17:34:43Z")

</div>

Hi there,

I have an error when I am not working with my react-native application for a while but the app is in the foreground at the same time.

I am getting this error. What is the reason?  
**Amity SDK (800000): Session state cannot change from establishing to tokenExpired**

 ![Simulator Screen Shot - iPhone 14 - 2023-02-28 at 21.01.29](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/5be10968580f8425403cb43c69133410856841a7.png)

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 2, 2023, 7:58am UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657/2 "2023-03-02T07:58:32Z")

</div>

Hi @Tech can we pls confirm the SDK version being used? Thank you

---

<div class="post-metadata">

**Author:** ![cijin](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cijin](https://forum.social.plus/u/cijin)\
**Post date:** [March 2, 2023, 8:29am UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657/3 "2023-03-02T08:29:24Z")

</div>

Hi @Tech,

Seems like you have found an edge case. The SDK tries to renew the auth token when it’s about to expire or expired.

Seems like the the request is canceled and the request that is being canceled is the one to update the session. I’ll create a ticket for it and keep you updated on the progress. 🙂

c.c @amitysupport

---

<div class="post-metadata">

**Author:** ![Tech](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tech](https://forum.social.plus/u/Tech)\
**Post date:** [March 2, 2023, 10:00am UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657/4 "2023-03-02T10:00:43Z")

</div>

Thank you. RN and Amity SDK versions:

```auto
"react-native": "0.70.6",
"@amityco/ts-sdk": "0.0.1-beta.39",

```

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 30, 2023, 10:17am UTC](https://forum.social.plus/t/error-session-state-cannot-change-from/657/5 "2023-03-30T10:17:51Z")

</div>

Hi @Tech

The issue should be fixed now.

Thank you,  
Amity Support
