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

Add sample for user ID and more validation logics #1447

Merged
merged 4 commits into from
Dec 7, 2018

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Dec 7, 2018

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 the userID passed is okay:

  • userID can be specified by props or embedded in Direct Line token.
    • If the userID is both specified and embedded, we prefer the embedded one from Direct Line token.
  • userID must be a string.
  • userID passed from props cannot prefix with dl_.
    • Embedded user ID is always prefixed with 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

  • Fix #1344, by updating README.md and adding validation logic for userID props, in #1447
    • If userID props present and also embedded in Direct Line token, will use the one from Direct Line token
    • If userID props present, they must be string and not prefixed with dl_, to avoid confusion between userID props and Direct Line embedded user ID (which is forgery-proof)
    • If userID props does not pass the validation test or not specified, Web Chat will use default-user instead

@compulim compulim added the 4.2 label Dec 7, 2018
@compulim compulim added this to the v4.2 milestone Dec 7, 2018
@compulim compulim added Enhancement p2 Nice to have area-docs Documentation required and removed 4.2 area-docs Documentation required labels Dec 7, 2018
Copy link
Contributor

@tonyanziano tonyanziano left a comment

Choose a reason for hiding this comment

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

👍

@compulim compulim merged commit f17f305 into microsoft:master Dec 7, 2018
@compulim compulim deleted the fix-1344 branch December 7, 2018 19:30
@coveralls
Copy link

coveralls commented Dec 8, 2018

Pull Request Test Coverage Report for Build 557

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 44.82%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/src/sagas/connectSaga.js 0 7 0.0%
Totals Coverage Status
Change from base Build 547: -0.2%
Covered Lines: 713
Relevant Lines: 1418

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-docs Documentation required p2 Nice to have
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebChat "default-user" causes shared user state
3 participants