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

fixed node-slack-sdk issue 1156, socketMode connection error not bein… #764

Merged
merged 1 commit into from Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/receivers/SocketModeReceiver.ts
Expand Up @@ -3,6 +3,7 @@ import { SocketModeClient } from '@slack/socket-mode';
import { createServer } from 'http';
import { Logger, ConsoleLogger, LogLevel } from '@slack/logger';
import { InstallProvider, CallbackOptions, InstallProviderOptions, InstallURLOptions } from '@slack/oauth';
import { WebAPICallResult } from '@slack/web-api';
import App from '../App';
import { Receiver, ReceiverEvent } from '../types';

Expand Down Expand Up @@ -147,16 +148,9 @@ export default class SocketModeReceiver implements Receiver {
this.app = app;
}

public start(): Promise<void> {
return new Promise((resolve, reject) => {
try {
// start socket mode client
this.client.start();
resolve();
} catch (error) {
reject(error);
}
});
public start(): Promise<void | WebAPICallResult> {
// start socket mode client
return this.client.start();
Comment on lines +151 to +153
Copy link
Member

Choose a reason for hiding this comment

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

Nice use of the OR instead of updating it to only WebAPICallResult.

Do we need to add any test coverage for this update?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we need test coverage? Yes
Do we have tests for SocketModeReceiver yet?....no :(

}

public stop(): Promise<void> {
Expand Down