wingbot-mongodb 4.2.11 → 4.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/b70eb1fa-a2df-4138-85a5-8f4e731c1f10.json +1 -0
- package/.nyc_output/processinfo/{6c56c7b8-6b82-4996-ac02-8b00e2cd98c7.json → b70eb1fa-a2df-4138-85a5-8f4e731c1f10.json} +1 -1
- package/.nyc_output/processinfo/index.json +1 -1
- package/package.json +1 -1
- package/src/StateStorage.js +8 -1
- package/.nyc_output/6c56c7b8-6b82-4996-ac02-8b00e2cd98c7.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"parent":null,"pid":
|
|
1
|
+
{"parent":null,"pid":210179,"argv":["/nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0/bin/node","/home/lika85456/workspace/wingbot/wingbot-mongodb/node_modules/.bin/mocha","./test"],"execArgv":[],"cwd":"/home/lika85456/workspace/wingbot/wingbot-mongodb","time":1775027578965,"ppid":210164,"coverageFilename":"/home/lika85456/workspace/wingbot/wingbot-mongodb/.nyc_output/b70eb1fa-a2df-4138-85a5-8f4e731c1f10.json","externalId":"","uuid":"b70eb1fa-a2df-4138-85a5-8f4e731c1f10","files":["/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BaseStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/defaultLogger.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/getNestedObjects.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/AttachmentCache.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/AuditLogStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BotConfigStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BotTokenStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/tokenFactory.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/ChatLogStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/NotificationsStorage.js","/home/lika85456/workspace/wingbot/wingbot-mongodb/src/StateStorage.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"processes":{"
|
|
1
|
+
{"processes":{"b70eb1fa-a2df-4138-85a5-8f4e731c1f10":{"parent":null,"children":[]}},"files":{"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BaseStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/defaultLogger.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/getNestedObjects.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/AttachmentCache.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/AuditLogStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BotConfigStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/BotTokenStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/tokenFactory.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/ChatLogStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/NotificationsStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"],"/home/lika85456/workspace/wingbot/wingbot-mongodb/src/StateStorage.js":["b70eb1fa-a2df-4138-85a5-8f4e731c1f10"]},"externalIds":{}}
|
package/package.json
CHANGED
package/src/StateStorage.js
CHANGED
|
@@ -13,6 +13,7 @@ const COMPOUND_INDEX = 'senderId_1_pageId_1_lastInteraction_-1';
|
|
|
13
13
|
|
|
14
14
|
const SEARCH = 'search-text';
|
|
15
15
|
const NAME = 'name_1';
|
|
16
|
+
const SENDER = 'senderId_1';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @typedef {object} State
|
|
@@ -59,6 +60,10 @@ class StateStorage extends BaseStorage {
|
|
|
59
60
|
this.logCollisionsAsErrors = false;
|
|
60
61
|
|
|
61
62
|
if (isCosmo) {
|
|
63
|
+
this.addIndex(
|
|
64
|
+
{ senderId: 1 },
|
|
65
|
+
{ name: SENDER }
|
|
66
|
+
);
|
|
62
67
|
this.addIndex(
|
|
63
68
|
{ name: 1 },
|
|
64
69
|
{ name: NAME }
|
|
@@ -247,7 +252,9 @@ class StateStorage extends BaseStorage {
|
|
|
247
252
|
if (!this._isCosmo) {
|
|
248
253
|
cursor
|
|
249
254
|
.project({ score: { $meta: 'textScore' } })
|
|
250
|
-
.sort({ score: { $meta: 'textScore' } });
|
|
255
|
+
.sort({ score: { $meta: 'textScore' }, lastInteraction: -1 });
|
|
256
|
+
} else {
|
|
257
|
+
cursor.sort({ lastInteraction: -1 });
|
|
251
258
|
}
|
|
252
259
|
} else {
|
|
253
260
|
cursor = c
|