mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: widget re-render issues, ws, build + rename pkg
This commit is contained in:
@@ -63,6 +63,10 @@ export class BlockService extends BaseService<Block, BlockPopulate, BlockFull> {
|
||||
blocks: BlockFull[],
|
||||
event: EventWrapper<any, any>,
|
||||
): Promise<BlockFull | undefined> {
|
||||
if (!blocks.length) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Search for block matching a given event
|
||||
let block: BlockFull | undefined = undefined;
|
||||
const payload = event.getPayload();
|
||||
|
||||
@@ -443,7 +443,7 @@ export class BotService {
|
||||
});
|
||||
|
||||
if (!blocks.length) {
|
||||
return this.logger.debug('No starting message blocks was found');
|
||||
this.logger.debug('No starting message blocks was found');
|
||||
}
|
||||
|
||||
// Search for a block match
|
||||
|
||||
@@ -67,7 +67,7 @@ export const settingModels: SettingCreateDto[] = [
|
||||
{
|
||||
group: 'nlp_settings',
|
||||
label: 'threshold',
|
||||
value: 0.9,
|
||||
value: 0.1,
|
||||
type: SettingType.number,
|
||||
config: {
|
||||
min: 0,
|
||||
|
||||
@@ -68,11 +68,8 @@ describe('WebsocketGateway', () => {
|
||||
it('should connect successfully', async () => {
|
||||
ioClient.connect();
|
||||
await new Promise<void>((resolve) => {
|
||||
// ioClient.on('connect', () => {
|
||||
// console.log('connected');
|
||||
// });
|
||||
ioClient.on('message', (data) => {
|
||||
expect(data.statusCode).toBe(200);
|
||||
ioClient.on('connect', () => {
|
||||
expect(true).toBe(true);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -255,22 +255,6 @@ export class WebsocketGateway
|
||||
this.logger.debug(`Number of connected clients: ${sockets?.size}`);
|
||||
|
||||
this.eventEmitter.emit(`hook:websocket:connection`, client);
|
||||
// @TODO : Revisit once we don't use anymore in frontend
|
||||
const response = new SocketResponse();
|
||||
client.send(
|
||||
response
|
||||
.setHeaders({
|
||||
'access-control-allow-origin':
|
||||
config.security.cors.allowOrigins.join(','),
|
||||
vary: 'Origin',
|
||||
'access-control-allow-credentials':
|
||||
config.security.cors.allowCredentials.toString(),
|
||||
})
|
||||
.status(200)
|
||||
.json({
|
||||
success: true,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async handleDisconnect(client: Socket): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user