From 5993eaa6dc9cca0a334d24db55c35a909dc50f5d Mon Sep 17 00:00:00 2001 From: Tadas Krivickas Date: Sat, 28 Mar 2020 12:58:48 +0200 Subject: [PATCH] Clear session on disconnect This caused old session being left intact when disconnected. When client attempts to connect to another provider, he is shown an old session/proposal (via SSE). --- core/connection/manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/connection/manager.go b/core/connection/manager.go index 3dcbb83fec..af2f935faf 100644 --- a/core/connection/manager.go +++ b/core/connection/manager.go @@ -169,8 +169,8 @@ func (manager *connectionManager) Connect(consumerID, accountantID identity.Iden manager.setStatus(statusConnecting()) defer func() { if err != nil { - manager.publishStateEvent(NotConnected) manager.setStatus(statusNotConnected()) + manager.publishStateEvent(NotConnected) } }() @@ -482,6 +482,7 @@ func (manager *connectionManager) saveSessionInfo(sessionInfo SessionInfo) { Status: SessionEndedStatus, SessionInfo: manager.getCurrentSession(), }) + manager.setCurrentSession(SessionInfo{}) return nil }) }