Skip to content

Commit

Permalink
Merge branch 'rm/335588' into 'master'
Browse files Browse the repository at this point in the history
prevent resetting lastDisconnectAt if it already exists to avoid user fetch bug on WS reconnect

See merge request kchat/webapp!890
  • Loading branch information
antonbuks committed Oct 24, 2024
2 parents 2f9d375 + d5a721a commit 9146b5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion webapp/channels/src/actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,12 @@ export async function reconnect(socketId) {
});

if (state.websocket.lastDisconnectAt) {
console.log('lastConnectAt', state.websocket.lastConnectAt);
console.log('lastDisconnectAt', state.websocket.lastDisconnectAt);
// eslint-disable-next-line no-console
console.log('[websocket_actions] lastDisconnectAt: ', state.websocket.lastDisconnectAt);
dispatch(checkForModifiedUsers(true));
dispatch(TeamActions.getMyKSuites());
console.log('[websocket_actions] lastDisconnectAt: ', state.websocket.lastDisconnectAt);
}

dispatch(resetWsErrorCount());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ export default function reducer(state = getInitialState(), action: AnyAction) {
return {
...state,
connected: false,
lastDisconnectAt: action.timestamp,
lastDisconnectAt: state.lastDisconnectAt || action.timestamp,
};
}

if (action.type === UserTypes.LOGOUT_SUCCESS) {
return getInitialState();
}

if (action.type === UserTypes.LOGOUT_SUCCESS) {
console.log('RESET WS STATE');
return getInitialState();
}

Expand Down

0 comments on commit 9146b5e

Please sign in to comment.