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

Locale Fixes #3739

Merged
merged 11 commits into from
Apr 24, 2020
Merged

Locale Fixes #3739

merged 11 commits into from
Apr 24, 2020

Conversation

mdrichardson
Copy link
Contributor

@mdrichardson mdrichardson commented Apr 14, 2020

Fixes: #3645
Once ported, this will also address this issue
When porting, I will also use the ported issues to address this issue, since these PRs touch a couple of the same files.

Changes

  • Adds locale for EndOfConversation events and activities
  • Adds a locale param/override for ContinueConversationAsync

Testing

I added to one existing test to check for locale with ContinueConversation. There wasn't really a good way to test for locale in the EndOfConversation events/activities.

Ports

I've got most of the work done for JS and Python as well, but am holding off on submitting PRs for those until this one is approved.

tomlm
tomlm previously requested changes Apr 15, 2020
Copy link
Contributor

@tomlm tomlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

await ContinueConversationAsync(claimsIdentity, reference, audience, null, callback, cancellationToken).ConfigureAwait(false);
}

public async Task ContinueConversationAsync(ClaimsIdentity claimsIdentity, ConversationReference reference, string audience, string locale, BotCallbackHandler callback, CancellationToken cancellationToken)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right way to do this. I think ConversationReference should capture the locale.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomlm I considered that and ran it by @Stevenic, who recommended the parameter approach since ConversationReference is a protocol data structure. Happy to make any changes necessary if we can get some consensus on which direction to go.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with the development team. Needs review by @dandriscoll.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, within this part of the stack, what the protocol implications of putting the locale here are. If we set locale within the conversationRefererence, does it end up on the wire somewhere?

(Setting locale within conversationReference for storage reasons is the right approach, assuming no externalities introduced by setting it here.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting point. Yes ConversationReference can be serialized into an activity, Activity in X can have a conversation reference to another conversation Y. ConversationReference is the information you need to be able to switch to Y if you need to. The pattern on this is that we need the original locale of the conversation Y to continue that conversation, so it seems like it should be in there, even if it gets serialized to wire.
@dandriscoll does that seem right to you?


In reply to: 409127783 [](ancestors = 409127783)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I talked with Dan and we agreed it is appropriate to modify ConversationReference.
Changes would be:

  • Modify ConversationReference in schema assembly to have locale
  • Modify CreateConversationReference to capture the locale.
    Then all people get the proper behavior without having to change their code.
    Rest of the APIS then are unchanged, except to use conversationReference.locale in appropriate place.

@mrivera-ms mrivera-ms added the blocked Current progress is blocked on something else. label Apr 15, 2020
@mrivera-ms mrivera-ms marked this pull request as draft April 17, 2020 18:51
@mrivera-ms
Copy link
Contributor

Blocked waiting for agreement. Email thread ongoing.

@tomlm tomlm added Draft PR and removed blocked Current progress is blocked on something else. labels Apr 18, 2020
@mdrichardson
Copy link
Contributor Author

@tomlm @Stevenic @dandriscoll Ready for review. There were several places that call new ConversationReference() and required adding Locale, so I went ahead and added it there, as well.

@mdrichardson mdrichardson dismissed tomlm’s stale review April 23, 2020 15:05

implemented changes

Copy link
Contributor

@tomlm tomlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@tomlm tomlm merged commit ca07d67 into master Apr 24, 2020
@tomlm tomlm deleted the mdrichardson/localeFixes branch April 24, 2020 01:27
xieofxie added a commit to xieofxie/botbuilder-dotnet that referenced this pull request May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set locale for EoC and event
7 participants