Skip to content

Clarify session disposal #526

@chlowell

Description

@chlowell

The API and documentation around session disposal are counterintuitive and contradictory such that it isn't clear how to go about this:

  • Session.Destroy() docs say it "destroys this session and releases all associated resources" and that the session can no longer be used after calling this method. So far so good: "destroy" implies an irreversible operation leaving nothing behind. However, the docs go on to contradict this by saying that the conversation can be resumed by calling Client.ResumeSession(). Maybe "destroy" is the wrong verb here; how about "suspend" or "close"?
  • Client.DeleteSession() naively appears equivalent to Session.Destroy() but apparently it's a superset: it does everything Destroy does plus it deletes files. It isn't clear how I should decide whether to "delete" or "destroy" a session.
  • Client.Stop() is documented as both "closing" and "destroying" all active sessions. This is confusing because "destroy" implies an irreversible operation leaving nothing behind while "close" is ambiguous (what happens to session resources on closure?). Because this method calls Session.Destroy() on each active session, it apparently leaves their files behind. Maybe this is again suggesting "close" as a better verb than "destroy". In any case, the docs should at least call out that Client.Stop() leaves session artifacts behind and SDK users who want to remove them must explicitly delete sessions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions