File tree 1 file changed +15
-2
lines changed 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -659,10 +659,23 @@ RestWrite.prototype.handleInstallation = function() {
659
659
// device token.
660
660
var delQuery = {
661
661
'deviceToken' : this . data . deviceToken ,
662
- 'installationId' : {
662
+ } ;
663
+ // We have a unique install Id, use that to preserve
664
+ // the interesting installation
665
+ if ( this . data . installationId ) {
666
+ delQuery [ 'installationId' ] = {
663
667
'$ne' : this . data . installationId
664
668
}
665
- } ;
669
+ } else if ( idMatch . objectId && this . data . objectId
670
+ && idMatch . objectId == this . data . objectId ) {
671
+ // we passed an objectId, preserve that instalation
672
+ delQuery [ 'objectId' ] = {
673
+ '$ne' : idMatch . objectId
674
+ }
675
+ } else {
676
+ // What to do here? can't really clean up everything...
677
+ return idMatch . objectId ;
678
+ }
666
679
if ( this . data . appIdentifier ) {
667
680
delQuery [ 'appIdentifier' ] = this . data . appIdentifier ;
668
681
}
You can’t perform that action at this time.
0 commit comments