Add sample for user ID and more validation logics#1447
Merged
compulim merged 4 commits intomicrosoft:masterfrom Dec 7, 2018
Merged
Add sample for user ID and more validation logics#1447compulim merged 4 commits intomicrosoft:masterfrom
compulim merged 4 commits intomicrosoft:masterfrom
Conversation
Pull Request Test Coverage Report for Build 557
💛 - Coveralls |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
If user ID is not specified, default will be
default-user.Although conversation is identified/partitioned by conversation ID, user state use user ID. That means, multiple conversations with same user ID will share same user state.
In README.md, we didn't spec out how to specify
userID. This PR will add the documentation and more checks to make sure theuserIDpassed is okay:userIDcan be specified by props or embedded in Direct Line token.userIDis both specified and embedded, we prefer the embedded one from Direct Line token.userIDmust be a string.userIDpassed from props cannot prefix withdl_.dl_, and this user ID is "forgery-proof". This checks reduces the confusion between a forgery-proof user ID and a non-forgery-proof one.Changelog
Added
README.mdand adding validation logic foruserIDprops, in #1447userIDprops present and also embedded in Direct Line token, will use the one from Direct Line tokenuserIDprops present, they must be string and not prefixed withdl_, to avoid confusion betweenuserIDprops and Direct Line embedded user ID (which is forgery-proof)userIDprops does not pass the validation test or not specified, Web Chat will usedefault-userinstead