@tiledesk/tiledesk-server 2.9.28 → 2.9.29

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+ # 2.9.29
9
+ - Fixed bug: try to update non existant project user (bot)
10
+
8
11
  # 2.9.28
9
12
  - Updated number_assigned_request count logic (removed incr/decr)
10
13
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.9.28",
4
+ "version": "2.9.29",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -43,10 +43,15 @@ class Listener {
43
43
  // New version of updateProjectUser() method.
44
44
  // This will not increment or decrement the number_assigned_requests field but search the exact number of assigned conversation to the project user
45
45
  updateProjectUser(id_user, id_project, operation) {
46
- winston.debug("Route queue updateProjectUser start operation: " + operation + "id_user " + id_user + " id_project " + id_project);
46
+ // winston.debug("Route queue updateProjectUser start operation: " + operation + "id_user " + id_user + " id_project " + id_project);
47
47
 
48
+ // escludi id_user che iniziano con bot_
49
+ if (id_user.startsWith('bot_')) {
50
+ return winston.warn("Chatbot is not a project_user. Skip update.")
51
+ }
52
+
48
53
  return Request.countDocuments({ id_project: id_project, participantsAgents: id_user, status: { $lt: 1000 } }, (err, requestsCount) => {
49
- console.log("requestsCount for id_user: ", id_user, "and project: ", id_project, "-->", requestsCount);
54
+ winston.verbose("requestsCount for id_user: ", id_user, "and project: ", id_project, "-->", requestsCount);
50
55
  if (err) {
51
56
  return winston.error(err);
52
57
  }