@ocap/indexdb-elasticsearch 1.18.69 → 1.18.71

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.
Files changed (2) hide show
  1. package/lib/db.js +5 -1
  2. package/package.json +5 -5
package/lib/db.js CHANGED
@@ -231,7 +231,7 @@ class ESIndexDB extends BaseIndexDB {
231
231
  account = await this.account.get(getMigratedFrom(account));
232
232
  }
233
233
 
234
- return related;
234
+ return related.filter(Boolean);
235
235
  }
236
236
 
237
237
  async listAssets({ ownerAddress, factoryAddress, paging, timeFilter = {} } = {}) {
@@ -240,6 +240,9 @@ class ESIndexDB extends BaseIndexDB {
240
240
  const possibleOwners = await this.getRelatedAddresses(ownerAddress);
241
241
  if (possibleOwners.length) {
242
242
  conditions.push({ terms: { owner: possibleOwners } });
243
+ } else {
244
+ // If we dit not find any owner state, just return empty
245
+ return { assets: [], account: null };
243
246
  }
244
247
  }
245
248
  if (factoryAddress) {
@@ -254,6 +257,7 @@ class ESIndexDB extends BaseIndexDB {
254
257
  return { assets: [], account: null };
255
258
  }
256
259
 
260
+ debug('listAssets query conditions', conditions);
257
261
  const pagination = formatPagination({ paging, defaultSortField: 'renaissanceTime' });
258
262
 
259
263
  const [result, account] = await Promise.all([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/indexdb-elasticsearch",
3
3
  "description": "OCAP indexdb adapter that uses elasticsearch as backend",
4
- "version": "1.18.69",
4
+ "version": "1.18.71",
5
5
  "author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/ArcBlock/asset-chain/issues",
@@ -38,12 +38,12 @@
38
38
  "test": "jest --forceExit --detectOpenHandles",
39
39
  "coverage": "npm run test -- --coverage"
40
40
  },
41
- "gitHead": "464d72d0a7107cb6f81afa78b74361018ecdc2e4",
41
+ "gitHead": "dc8eb886b0ed25f35ac06971bdf4c87ad6a49186",
42
42
  "dependencies": {
43
- "@arcblock/did": "1.18.69",
43
+ "@arcblock/did": "1.18.71",
44
44
  "@elastic/elasticsearch": "7.13.0",
45
- "@ocap/indexdb": "1.18.69",
46
- "@ocap/util": "1.18.69",
45
+ "@ocap/indexdb": "1.18.71",
46
+ "@ocap/util": "1.18.71",
47
47
  "axios": "^0.27.2",
48
48
  "bn.js": "^5.2.1",
49
49
  "debug": "^4.3.4",