go-sfdc icon indicating copy to clipboard operation
go-sfdc copied to clipboard

Session expired or invalid

Open Guitarbum722 opened this issue 5 years ago • 0 comments

What is the desired behavior when an OAuth token is expired/invalid?

For example, I created a session, initialized a Resource and then called resource.Query() in a loop on a 5 second delay just to simulate some typical usage by an automated client.

I logged into my Org and removed the client's session.

SFDC returns INVALID_SESSION_ID: Session expired or invalid, obviously. Thus, an error is returned (I assumed via the call to queryResponse().

  • Is there anything besides the error string I could inspect if this occurs?
  • Am I missing functionality that you've already implemented?
  • Is there a benefit to re-auth and/or letting the caller know that they should authenticate and retry?

Guitarbum722 avatar May 28 '19 02:05 Guitarbum722