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

765 'ChatRoom' & 'ChatMessage' contexts and 'SendChatMessage' Intent #794

Conversation

symphony-jean-michael
Copy link
Contributor

@symphony-jean-michael symphony-jean-michael commented Aug 5, 2022

This PR:

  • updates the 'StartChat' intent to return a reference to the new created Chat room (ChatRoom)
  • supports the possibility to send messages in existing chats (New intent 'SendChatMessage')

See initial discussion #765

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 5, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@netlify
Copy link

netlify bot commented Aug 5, 2022

Deploy Preview for lambent-kulfi-cf51a7 ready!

Name Link
🔨 Latest commit 6a62c40
🔍 Latest deploy log https://app.netlify.com/sites/lambent-kulfi-cf51a7/deploys/636cfc4f7ce5550008a05541
😎 Deploy Preview https://deploy-preview-794--lambent-kulfi-cf51a7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@symphony-jean-michael symphony-jean-michael changed the title WIP: Feature/SendChatMessage WIP: 'ChatRoom' and 'SendChatMessage' Aug 5, 2022
@symphony-jean-michael symphony-jean-michael changed the title WIP: 'ChatRoom' and 'SendChatMessage' 'ChatRoom' and 'SendChatMessage' Aug 5, 2022
@symphony-jean-michael symphony-jean-michael marked this pull request as ready for review August 5, 2022 09:54
@mistryvinay mistryvinay added enhancement New feature or request intents Context Data & Intents Contexts & Intents Discussion Group labels Aug 17, 2022
@mistryvinay mistryvinay added this to the 2.1-candidates milestone Aug 24, 2022
@mistryvinay mistryvinay linked an issue Aug 24, 2022 that may be closed by this pull request
@mistryvinay mistryvinay changed the title 'ChatRoom' and 'SendChatMessage' 765 'ChatRoom' and 'SendChatMessage' Aug 24, 2022
@mistryvinay mistryvinay requested review from kriswest, hughtroeger and a team August 24, 2022 09:48
fix typo for roomId.
Copy link
Contributor

@mistryvinay mistryvinay left a comment

Choose a reason for hiding this comment

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

LGTM, need another maintainer to also confirm.

@kriswest kriswest changed the title 765 'ChatRoom' and 'SendChatMessage' 765 'ChatRoom' & 'ChatMessage' contexts and 'SendChatMessage' Intent Sep 1, 2022
Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

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

Added some suggestions to clarify a few things. Overall looks pretty good

Comment on lines 34 to 48
const intentResolution = await fdc3.raiseIntent("StartChat", context);

const chatRoom = intentResolution.getResult():

/* // The chatRoom will be like:
chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd flip the order of the code and context example (to match convention on other pages). See https://fdc3.finos.org/docs/context/ref/Chart for an example

Suggested change
const intentResolution = await fdc3.raiseIntent("StartChat", context);
const chatRoom = intentResolution.getResult():
/* // The chatRoom will be like:
chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};
*/
const chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};
//Chat rooms are returned by the StartChat intent as a result
const intentResolution = await fdc3.raiseIntent("StartChat", context);
try {
const chatRoom = await intentResolution.getResult():
} catch (error) {
//chat room was not created...
}

docs/context/ref/ChatRoom.md Outdated Show resolved Hide resolved
docs/context/ref/ChatRoom.md Outdated Show resolved Hide resolved
---
# `ChatRoom`

Reference to a chat room.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add detail on why we need one (to send further messages to the room? to log in a CRM maybe?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Additional text added.

| `uri` | string | No | `'http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA'` |
| `name` | string | No | `'My new room'` |

The `uri` is an universal url to access to the room. It could be opened from a browser, a mobile app, etc...
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `uri` is an universal url to access to the room. It could be opened from a browser, a mobile app, etc...
The `uri` field should be populated with a URL to access the room, which may be used outside of the context of a Desktop Agent (for example in a browser, mobile application etc.).

Minor comment: is it expected to be a URL or URI? All URLs are URIs but not all URIs are URLs (although I don't know many people that are clear on the distinction). If its always expected to be retreivable in a browser (taking you to a web page where you can access teh item) rather than just acting as an identity, then its a URL (and should be named as such).

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we okay with the updated text @kriswest ?

docs/intents/ref/SendChatMessage.md Outdated Show resolved Hide resolved
docs/context/ref/ChatMessage.md Outdated Show resolved Hide resolved
@symphony-jean-michael
Copy link
Contributor Author

@kriswest I updated the PR taking into account your remarks. Could you have a second look? Thanks

Copy link
Contributor

@mistryvinay mistryvinay left a comment

Choose a reason for hiding this comment

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

Have left some comments on some minor changes that may still be outstanding.

@mistryvinay
Copy link
Contributor

Are we still pending an updated description of use-cases for starting a chat?

@symphony-jean-michael
Copy link
Contributor Author

Hi @mistryvinay

  • "Deal with review comments and suggestions."
    It seems to me that I've taken into account all the comments and updated the PR accordingly. Could you tell me which comment you're referring to?
  • "Consider expanding the description of StartChat to include more details on use-cases for starting a chat from a different application (e.g. a research app or OMS)"
    Sorry, but I don't really know what to add. You want me to add a message in StartChat explaining why a user would want to start a chat from another application, right? Do you have an idea of a description to add? It would be very helpful for me. 😅

@mistryvinay
Copy link
Contributor

Hi @mistryvinay

  • "Deal with review comments and suggestions."
    It seems to me that I've taken into account all the comments and updated the PR accordingly. Could you tell me which comment you're referring to?
  • "Consider expanding the description of StartChat to include more details on use-cases for starting a chat from a different application (e.g. a research app or OMS)"
    Sorry, but I don't really know what to add. You want me to add a message in StartChat explaining why a user would want to start a chat from another application, right? Do you have an idea of a description to add? It would be very helpful for me. 😅

Currently we have:

# `StartChat`

Initiate a chat with a contact, a list of contacts or detailed initialization settings.

Maybe something along the lines of:

# `StartChat`

Initiate a chat with a contact, a list of contacts or detailed initialization settings.  This could be launched from within another application. For example initiating a chat from a research or OMS application.

@symphony-jean-michael
Copy link
Contributor Author

Hi @mistryvinay
Thank you for your feedback. I updated the PR accordingly.

Copy link
Contributor

@mistryvinay mistryvinay left a comment

Choose a reason for hiding this comment

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

LGTM.

---
# `ChatRoom`

Reference to a chat room.
Copy link
Contributor

Choose a reason for hiding this comment

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

Additional text added.

docs/context/ref/ChatRoom.md Outdated Show resolved Hide resolved
"type": { "const": "fdc3.chat.room" },
"providerName": { "type": "string" },
"id": { "type": "object" },
"uri": { "type": "string" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be updated to url now?

"type": { "const": "fdc3.chat.room" },
"providerName": { "type": "string" },
"id": { "type": "object" },
"uri": { "type": "string" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this row, should this be updated to url?

@kriswest
Copy link
Contributor

kriswest commented Nov 3, 2022

Add a CHANGELOG.md entry in the unreleased section please

@symphony-jean-michael
Copy link
Contributor Author

Hi @kriswest @mistryvinay
I've updated the PR accordingly to your remarks. Can you have a second look, please?
Thanks

@symphony-jean-michael
Copy link
Contributor Author

FYI, this PR is included in new one #882

@kriswest kriswest modified the milestones: 2.1-candidates, 2.1 Apr 27, 2023
@kriswest kriswest removed this from the 2.1 milestone Jul 25, 2023
@bingenito bingenito mentioned this pull request Nov 6, 2023
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context Data & Intents Contexts & Intents Discussion Group enhancement New feature or request intents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'ChatRoom' and 'SendChatMessage'
4 participants