@ocap/indexdb-elasticsearch 1.18.70 → 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 +4 -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) {
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.70",
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": "1f83cffbbb5ac5f34b07cb9302676352ac174286",
41
+ "gitHead": "dc8eb886b0ed25f35ac06971bdf4c87ad6a49186",
42
42
  "dependencies": {
43
- "@arcblock/did": "1.18.70",
43
+ "@arcblock/did": "1.18.71",
44
44
  "@elastic/elasticsearch": "7.13.0",
45
- "@ocap/indexdb": "1.18.70",
46
- "@ocap/util": "1.18.70",
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",