Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where restart conversation was not clearing history. #1325

Merged
merged 1 commit into from Feb 22, 2019

Conversation

Projects
None yet
3 participants
@tonyanziano
Copy link
Contributor

tonyanziano commented Feb 21, 2019

Fixes #1323

@tonyanziano tonyanziano force-pushed the toanzian/restart-convo branch from 79114ad to e721e07 Feb 21, 2019

@coveralls

This comment has been minimized.

Copy link

coveralls commented Feb 21, 2019

Pull Request Test Coverage Report for Build 2103

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 54.916%

Files with Coverage Reduction New Missed Lines %
packages/app/client/src/ui/editor/emulator/emulator.tsx 1 72.02%
Totals Coverage Status
Change from base Build 2097: 0.03%
Covered Lines: 4861
Relevant Lines: 8310

💛 - Coveralls
await CommandServiceImpl.remoteCall(SharedConstants.Commands.Emulator.SetCurrentUser, newUserId);
this.props.updateChat(this.props.documentId, { userId: newUserId });
// start conversation with new convo id & user id
this.startNewConversation(undefined, true, true);

This comment has been minimized.

@compulim

compulim Feb 22, 2019

Contributor

Why don't we create unique ID before we call startNewConversation?

For example,

this.startNewConversation({
  ...this.props,
  document: {
    ...this.props.document,
    conversationId: uniqueIdv4(),
    userId: uniqueIdv4()
  }
});

And can we always call setCurrentUser every time we call startNewConversation?

Your existing logic may be good or have some reasons behind, I just didn't see through it yet. If there are any, please consider me approved. 😅

This comment has been minimized.

@tonyanziano

tonyanziano Feb 22, 2019

Author Contributor

I don't see why this approach wouldn't work. I actually like it a lot more than making a function call like (undefined, true, true) -- seems odd

This comment has been minimized.

@tonyanziano

tonyanziano Feb 22, 2019

Author Contributor

I tried this approach out and it actually causes new livechat windows to be opened on every restart, as well as prevents webchat from connecting to directline when restarting with a new user id. I'm not entirely sure why though. I believe it might have to do with setting the current user every time.

break;
}

case SameUserId:
this.props.trackEvent('conversation_restart', {
userId: 'same',
});
this.startNewConversation();
// start conversation with new convo id
this.startNewConversation(undefined, true);

This comment has been minimized.

@compulim

compulim Feb 22, 2019

Contributor

Or should it be like this?

Suggested change
this.startNewConversation(undefined, true);
this.startNewConversation(undefined, true, false);

@tonyanziano tonyanziano force-pushed the toanzian/restart-convo branch from e721e07 to 4433bb9 Feb 22, 2019

@tonyanziano tonyanziano merged commit 40d4d25 into v4.3 Feb 22, 2019

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 54.916%
Details
license/cla All CLA requirements met.
Details

@tonyanziano tonyanziano deleted the toanzian/restart-convo branch Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.