Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Conversation

@shiqimei
Copy link
Contributor

@shiqimei shiqimei commented Nov 20, 2019

What? β›΅

Closes #188

Why? πŸ€”

Ref: #188 (comment)

Links 🌎

PS πŸ‘€

It also depends on changes in the Rocket.Chat side: RocketChat/Rocket.Chat#15837

@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #189 into master will decrease coverage by 2.29%.
The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #189     +/-   ##
=========================================
- Coverage   56.64%   54.34%   -2.3%     
=========================================
  Files          77       69      -8     
  Lines        2560     2462     -98     
  Branches      370      372      +2     
=========================================
- Hits         1450     1338    -112     
- Misses       1110     1124     +14
Impacted Files Coverage Ξ”
src/server/accessors/LivechatRead.ts 20% <0%> (-13.34%) ⬇️
src/server/managers/AppListenerManager.ts 4.33% <0%> (-0.18%) ⬇️
src/server/compiler/AppImplements.ts 100% <100%> (ΓΈ) ⬆️
src/server/errors/index.ts
src/server/managers/index.ts
src/server/accessors/index.ts
src/server/marketplace/license/index.ts
src/server/compiler/index.ts
src/server/storage/index.ts
src/server/logging/index.ts
... and 1 more

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 32be2d2...04dafdd. Read the comment docs.

@renatobecker-zz
Copy link

renatobecker-zz commented Nov 22, 2019

Guys!
I just found a problem related to the IVisitor interface.
As you can see here, the fields updatedAt and visitorEmails are not mandatory, but the interface is requiring them as shown below:

export interface IVisitor {
    id?: string;
    token: string;
    username: string;
    updatedAt: Date;
    name: string;
    department?: string;
    phone?: Array<IVisitorPhone>;
    visitorEmails: Array<IVisitorEmail>;
    customFields?: {
        [key: string]: any;
    };
}

What do you guys think about it? Shall we fix it?
Thanks.


// tslint:disable-next-line
public async executeListener(int: AppInterface, data: IMessage | IRoom | IUser): Promise<void | boolean | IMessage | IRoom | IUser> {
public async executeListener(int: AppInterface, data: IMessage | IRoom | IUser | ILivechatRoom): Promise<void | boolean | IMessage | IRoom | IUser | ILivechatRoom> {
Copy link
Member

Choose a reason for hiding this comment

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

This is getting kinda hard to manage... In the rich messages we have added one type here as well, and this tends to keep growing. We should think of a way of refactoring this in the future

@renatobecker-zz
Copy link

renatobecker-zz commented Nov 25, 2019

@d-gubert / @lolimay, just a quick question:

The code below is returning undefined when creating a new message, but it's supposed to return the id of the new message, right?

    ...
    const msg = modify.getCreator().startLivechatMessage()
    .setToken(token)
    .setVisitor(visitor)
    .setRoom(room);

    if (text) {
        msg.setText(text);
    }

    if (attachment) {
        msg.addAttachment(attachment);
    }

    return modify.getCreator().finish(msg);

Do you guys see anything wrong with my code?

Co-Authored-By: Douglas Gubert <d-gubert@users.noreply.github.com>
@d-gubert
Copy link
Member

@renatobecker nothing appears wrong with your code. It's weird that the id is not being returned since the implementation seems to be taking that into account πŸ€”

@d-gubert d-gubert changed the base branch from master to beta November 27, 2019 17:07
@d-gubert d-gubert changed the base branch from beta to master November 27, 2019 17:13
@d-gubert d-gubert merged commit d120855 into master Nov 27, 2019
@d-gubert d-gubert deleted the feat.ILivechatRoomClosedHander branch November 27, 2019 17:16
@shiqimei shiqimei restored the feat.ILivechatRoomClosedHander branch November 28, 2019 14:51
shiqimei added a commit that referenced this pull request Nov 28, 2019
@shiqimei shiqimei deleted the feat.ILivechatRoomClosedHander branch November 28, 2019 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to listen the 'livechat.closeRoom' callback

3 participants