Skip to content

Commit

Permalink
fix(EntityManager): bloomfilter initialization and Push tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuecklers committed Apr 24, 2022
1 parent a004f48 commit a9a2c07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 7 additions & 3 deletions lib/EntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,11 @@ export class EntityManager extends Lockable {
if (this.connectData.user) {
this._updateUser(this.connectData.user, true);
}
}

if (this.bloomFilterRefresh > 0 && this.connectData.bloomFilter && atob && !isNode) {
this._updateBloomFilter(this.connectData.bloomFilter);
}
const bloomFilter = this.entityManagerFactory.connectData?.bloomFilter;
if (this.bloomFilterRefresh > 0 && bloomFilter && atob && !isNode) {
this._updateBloomFilter(bloomFilter);
}
}

Expand Down Expand Up @@ -1126,6 +1127,9 @@ export class EntityManager extends Lockable {
metadata.type.fromJsonValue(metadata, obj, device, { persisting: true });

this.deviceMe = device;
if (this.connectData) {
this.connectData.device = obj;
}
return device;
}

Expand Down
7 changes: 3 additions & 4 deletions spec/pushnotification.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

if (typeof module !== 'undefined') {
require('./node');
}
Expand All @@ -8,7 +6,7 @@ describe('Test Push Notifications', function () {
var emf, db, lock;

var TEST_GCM_DEVICE = 'APA91bFBRJGMI2OkQxhV3peP4ncZOIxGJBJ8s0tkKyWvzQErpZmuSzMzm6ugz3rOauMQ1CRui0bBsEQvuN0W8X1wTP547C6MSNcErnNYXyvc1F5eKZCs-GAtE_NcESolea2AM6_cRe9R';
var TEST_GCM_APIKEY = 'AIzaSyAQvWS3mtqnTfLAA3LjepyQRrqDisVRnE0';
var TEST_GCM_APIKEY = 'AAAAGvyekVM:APA91bHPRl-MulY1xAoH2LlGpvvUezPc_unKxfooN7G6rAVyKRINhoriPKrHUd5g5fdSyL3xl3B4NteDFMYXe589-UOtx0TXudwWjtG3eNUEhNXdsftC6BmLJEzxiiywSUzsa8Stogw8';

before(function () {
this.timeout(40000);
Expand All @@ -26,7 +24,8 @@ describe('Test Push Notifications', function () {
lock = new db.Lock({ id: 'push' });
return createLock();
}).then(function () {
var msg = new DB.message.GCMAKey(TEST_GCM_APIKEY);
var msg = new DB.message.GCMAKey();
msg.entity(TEST_GCM_APIKEY, 'text');
return emf.send(msg);
})
.then(function () {
Expand Down

0 comments on commit a9a2c07

Please sign in to comment.