diff --git a/packages/assistify-ai/client/public/stylesheets/smarti.css b/packages/assistify-ai/client/public/stylesheets/smarti.css index 7d36d90f6deb..a7fe024135a9 100644 --- a/packages/assistify-ai/client/public/stylesheets/smarti.css +++ b/packages/assistify-ai/client/public/stylesheets/smarti.css @@ -65,8 +65,7 @@ } .smarti #widgetContainer #widgetWrapper #widgetFooter { - position: absolute; - bottom: 0; + position: relative; background: #f4f4f4; color: #747474; opacity: 1; diff --git a/packages/assistify-ai/server/SmartiProxy.js b/packages/assistify-ai/server/SmartiProxy.js index 92cc65d6d097..8f94bc84e706 100644 --- a/packages/assistify-ai/server/SmartiProxy.js +++ b/packages/assistify-ai/server/SmartiProxy.js @@ -48,6 +48,9 @@ export class SmartiProxy { SystemLogger.debug('Got unexpected result from Smarti', method, 'to', url, 'response', JSON.stringify(response)); } } catch (error) { + SystemLogger.error('Could not complete', method, 'to', url, error.response); + SystemLogger.debug(error); + if (onError) { const recoveryResult = onError(error); if (recoveryResult !== undefined) { diff --git a/packages/assistify-ai/server/lib/SmartiAdapter.js b/packages/assistify-ai/server/lib/SmartiAdapter.js index 94e28b5ddc68..1026a8db18a3 100644 --- a/packages/assistify-ai/server/lib/SmartiAdapter.js +++ b/packages/assistify-ai/server/lib/SmartiAdapter.js @@ -87,10 +87,16 @@ export class SmartiAdapter { 'content': message.msg, 'user': { 'id': message.u._id - } + }, + 'metadata': {} //,"private" : false }; + if (message.origin === 'smartiWidget') { + requestBodyMessage.metadata.skipAnalysis = true; + } + + SystemLogger.debug('RocketChatMessage:', message); SystemLogger.debug('Message:', requestBodyMessage); let conversationId = SmartiAdapter._getConversationId(message.rid, message); diff --git a/packages/assistify-ai/server/methods/SmartiWidgetBackend.js b/packages/assistify-ai/server/methods/SmartiWidgetBackend.js index 5e08574ff590..17b0edf48bb2 100644 --- a/packages/assistify-ai/server/methods/SmartiWidgetBackend.js +++ b/packages/assistify-ai/server/methods/SmartiWidgetBackend.js @@ -33,9 +33,12 @@ Meteor.methods({ } } )(verbs.get, `legacy/rocket.chat?channel_id=${ channelId }`, null, (error) => { - // 404 is expected if no mapping exists - if (error.response.statusCode === 404) { - return null; + if (error) { + // 404 is expected if no mapping exists + if (error.response && error.response.statusCode === 404) { + return null; + } + return {errorCode: error.code}; } }); @@ -84,7 +87,15 @@ Meteor.methods({ return !RocketChat.authz.hasPermission(userId, 'send-many-messages'); } } - )(verbs.get, `conversation/${ conversationId }/analysis`); + )(verbs.get, `conversation/${ conversationId }/analysis`, null, (error) => { + if (error) { + // 404 is expected if no mapping exists + if (error.response && error.response.statusCode === 404) { + return null; + } + return {errorCode: error.code}; + } + }); }, /**