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

Discussion create #229

Closed
wants to merge 2 commits into from
Closed

Discussion create #229

wants to merge 2 commits into from

Conversation

marceloschmidt
Copy link
Member

What? ⛵

  • Added discussionRoom and type to messages, and added parentRoom to room;

Why? 🤔

This will allow us to create discussions via apps.

@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #229 into master will decrease coverage by 0.31%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #229      +/-   ##
=========================================
- Coverage   53.81%   53.5%   -0.32%     
=========================================
  Files          70      70              
  Lines        2568    2583      +15     
  Branches      380     380              
=========================================
  Hits         1382    1382              
- Misses       1186    1201      +15
Impacted Files Coverage Δ
src/server/rooms/Room.ts 52.94% <ø> (ø) ⬆️
src/server/messages/Message.ts 25% <ø> (ø) ⬆️
src/server/accessors/RoomBuilder.ts 93.82% <0%> (-6.18%) ⬇️
src/server/accessors/MessageBuilder.ts 78.57% <0%> (-7.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10c4e8e...4a5d4f8. Read the comment docs.

@d-gubert d-gubert changed the base branch from master to beta February 21, 2020 18:25
@d-gubert d-gubert changed the base branch from beta to master February 21, 2020 18:46
@d-gubert d-gubert changed the base branch from master to beta February 24, 2020 23:53
@d-gubert
Copy link
Member

The current implementation allows a discussion to be created without a parent/origin message in the parent room. Is this something we'd like to allow? @marceloschmidt @ggazzo @sampaiodiego

@marceloschmidt
Copy link
Member Author

Now that you mentioned, it doesn't seem to make much sense.

@marceloschmidt
Copy link
Member Author

Though, do we have this type of logic here?

@d-gubert
Copy link
Member

@marceloschmidt The API as it is allows that to happen as much as the implementation on the Rocket.Chat side, so if we want to change something, we're gonna have to change in both places 😛

I think the best thing we could do here for the developer is to provide a createDiscussion(discussion: IRoom, origin: IMessage) method, which would create the discussion AND the origin/parent message if needed.

The only problem is... where do we put it? In the IModify interface? 🤔

@sampaiodiego
Copy link
Member

on Rocket.Chat side we have a createDiscussion method that handles everything, you can provide either a roomId or a messageId..

I think the best thing we could do here for the developer is to provide a createDiscussion(discussion: IRoom, origin: IMessage) method, which would create the discussion AND the origin/parent message if needed.

an API like this makes more sense to me 👍

@d-gubert
Copy link
Member

d-gubert commented Mar 2, 2020

Oooh, I've recently come to realize that a message is always created along with a discussion, even if the user clicks on the Start a discussion message action 😬 So if we were to create a bridge method that calls the createDiscussion method on the Rocket.Chat side, it looks like a perfect solution then?

I might be able to give this a try today

@marceloschmidt
Copy link
Member Author

@d-gubert did you manage to do it?

@shiqimei shiqimei self-assigned this Mar 26, 2020
@marceloschmidt
Copy link
Member Author

I'm closing this one in favor of a different branch with the proposed approach.

@marceloschmidt marceloschmidt deleted the discussion-create branch March 27, 2020 22:10
@shiqimei shiqimei removed their assignment Mar 31, 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.

4 participants