Skip to content

Commit

Permalink
fix: 修复单条消息id属性获取错了导致的插入数据库失败的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
陈子云 authored and 陈子云 committed Nov 11, 2021
1 parent 9665158 commit 80d4574
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.4

修复收到单条消息的 id 读取错了属性值导致 sqlite 插入不进去的问题
## 2.2.3

解决 logger 覆盖问题而产生的 destroy 报错。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kit-fullsearch-electron",
"version": "2.2.3",
"version": "2.2.4",
"description": "全文搜索组件,基于网易云信web端im sdk,用于Electron",
"main": "lib/index.js",
"module": "lib/index.js",
Expand Down
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,6 @@ const fullText = (NimSdk: any) => {
return
}
const msgs = obj.msgs && obj.msgs.filter(item => item.text && item.idClient)
.map(item => {
item._id = item.idClient
return item;
})
resolve(msgs)
},
})
Expand Down Expand Up @@ -652,7 +648,7 @@ const fullText = (NimSdk: any) => {
this.searchDB.exec('BEGIN TRANSACTION;')
msgs.forEach((msg: any) => {
this.searchDB.run(`INSERT OR IGNORE INTO \`nim_msglog\` VALUES(NULL,${column});`, [
msg._id,
msg.idClient,
msg.text,
msg.sessionId,
msg.from,
Expand Down

0 comments on commit 80d4574

Please sign in to comment.