# Missing Call to AirVantage Session State Handler

**URL:** https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359
**Category:** Legato Application Framework
**Created:** [May 23, 2019, 3:55am UTC](https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359 "2019-05-23T03:55:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [May 23, 2019, 3:55am UTC](https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359/1 "2019-05-23T03:55:44Z")

</div>

I posted this here in the Mangoh [forum](https://forum.mangoh.io/t/missing-call-to-airvantage-session-state-handler/2650) and I’m reposting here as this seems like a serious issue.

I have been working with @jchitty and @Prush on these questions [Multiple Apps Calling `le_avdata_RequestSession`](https://forum.mangoh.io/t/multiple-apps-calling-le-avdata-requestsession/2646) and [Poor Signal Quality and Air Vantage Data Costs](https://forum.mangoh.io/t/poor-signal-quality-and-air-vantage-data-costs/2636/)

Based on a discussion with @jchitty yesterday I have added AirVantage session state handlers to all (3) apps that request sessions. I have one test unit the I popped the antenna off and then back on after a few minutes (yes I know not recommended but I don’t have attunators at the moment) and this resulted in only 2 of the 3 handlers being called before the app is restarted. See logs below.

If you search for `AV Session State Handler` you will see two calls to the handler before the third app terminates due to a failed record push @ 22:32:10. Then you see three calls to the handler after app restarts and the system is trying to connect to AirVantage @ 22:34:15 and then another three calls to the handler once the system is again connected to AirVantage @ 22:37:38

The other interesting thing is I have a PushRecord callback handler that also doesn’t seem to be called as there are no log printouts.

Thoughts, why are all 3 apps receiving the state change.

Running Legato 18.09.0.

[Missing Handler Call Log May 17th.log](https://forum.legato.io/uploads/short-url/xr8L1LxilsK2Chmhg2L7C7NtPyx.log) (51.3 KB)

Thanks

---

<div class="post-metadata">

### Author: ![muralinagraj](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@muralinagraj](https://forum.legato.io/u/muralinagraj)
#### Post date: [August 1, 2019, 2:53pm UTC](https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359/2 "2019-08-01T14:53:32Z")

</div>

Hi @dbeckwith,  
I am bit confused, Your question is “why are all 3 apps receiving the state change” or “why are all 3 apps **NOT** receiving the state change” when you remove the antenna and put it back ?

Please clarify.

Regards,  
Muralidhara N.

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 1, 2019, 3:49pm UTC](https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359/3 "2019-08-01T15:49:37Z")

</div>

@muralinagraj I was asking why all 3 apps were **NOT** receiving the state change notification.

---

<div class="post-metadata">

### Author: ![muralinagraj](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@muralinagraj](https://forum.legato.io/u/muralinagraj)
#### Post date: [August 8, 2019, 12:36pm UTC](https://forum.legato.io/t/missing-call-to-airvantage-session-state-handler/4359/4 "2019-08-08T12:36:33Z")

</div>

Hi @dbeckwith,  
From the logs provided there is no much information why the 3rd application(sensorToCloud) did not receive the the state change notification after you remove the antenna. But i think it looks a timing issue, By the time state change notification came, sensorToCloud app was terminated/restarted because it has been set to Assert if it fails to push the data.

Please verify again by removing the Assert condition when the sensorToCloud app fails to push the data **OR** provide the debug legato logs with the issue reproduced for us to analyze.

To enable the debug legato logs please run the command “log level DEBUG” on the console.

BTW, This scenario is 100% reproducible?

Regards,  
Muralidhara N
