I have a Lightning application, which is running in a Visualforce page, so it can be accessed from Classic Salesforce.
If I open the page with the app, use the app for a while, then leave it for a while, when I try and use the page and it makes a call to the APEX controller I get an exception.
The exception detail sent from APEX is:
"defaultHandler":function() {$A.clientService.setOutdated()},
"event":{
"descriptor":"markup://aura:clientOutOfSync",
"eventDef":{
"s":1,
"v":{
"descriptor":"markup://aura:clientOutOfSync",
"type":"APPLICATION",
"superDef":{
"s":2,
"v":{
"descriptor":"markup://aura:applicationEvent",
"type":"APPLICATION",
"xs":"G",
"attributes":{
}
}
},
"attributes":{
}
}
}
},
"exceptionEvent":true
The stack trace in JavaScript is:
Received exception event from server
at AuraClientService.$processErrors$ (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:9591:19)
at AuraClientService.$receive$ (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:9571:16)
at TransportMetricsPlugin.$receiveOverride$ (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:16108:23)
at Object.Aura.$Utils$.$Override$.$continuation$ (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:2912:20)
at Override.Aura.$Utils$.$Override$.start (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:2890:30)
at XMLHttpRequest.onReady (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:9463:12)
at XMLHttpRequest.<anonymous> (https://xxx.visual.force.com/auraFW/javascript/ot_aUc3gWVJCViXm5-AclQ/aura_proddebug.js:14713:23)
When this happens the app becomes unusable until the user manually reloads the page. All calls further to the server fail.
This is happening in a Lightning app hosted within a Visualforce page. How do I stop this happening ?