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

Should allow create conversation with user record and id #236

Closed
carmenlau opened this issue Dec 10, 2018 · 0 comments
Closed

Should allow create conversation with user record and id #236

carmenlau opened this issue Dec 10, 2018 · 0 comments
Assignees
Labels

Comments

@carmenlau
Copy link
Contributor

carmenlau commented Dec 10, 2018

Expected Results

In js sdk, user should be able to create chat with user record or id, so all of the following call should be valid.

await skygearChat.createDirectConversation(user._id, null)
await skygearChat.createDirectConversation(user, null)
await skygearChat.createDirectConversation(user.id, null)

Actual Results

  • Create conversation correctly

    await skygearChat.createDirectConversation(user._id, null)
    
  • Got invalid user error

    await skygearChat.createDirectConversation(user, null)
    
  • Always creating conversation successfully which is incorrect, should have duplicate conversation error when creating for the second time

    await skygearChat.createDirectConversation(user.id, null)
    

Example

To test it in js:

const user = (await skygear.publicDB.query(new skygear.Query(skygear.UserRecord).contains('username', ['user1'])))[0]
await skygearChat.createDirectConversation(user, null)
@carmenlau carmenlau changed the title Should allow create conversation with user record and user id Should allow create conversation with user record and id Dec 10, 2018
@carmenlau carmenlau self-assigned this Dec 10, 2018
Steven-Chan added a commit that referenced this issue Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants