@@ -76,7 +76,6 @@ export class PersistentConnection extends ServerActions {
76
76
id = PersistentConnection . nextPersistentConnectionId_ ++ ;
77
77
private log_ = logWrapper ( 'p:' + this . id + ':' ) ;
78
78
79
- /** @private {Object} */
80
79
private interruptReasons_ : { [ reason : string ] : boolean } = { } ;
81
80
private listens_ : { [ path : string ] : { [ queryId : string ] : ListenSpec } } = { } ;
82
81
private outstandingPuts_ : OutstandingPut [ ] = [ ] ;
@@ -88,26 +87,19 @@ export class PersistentConnection extends ServerActions {
88
87
private securityDebugCallback_ : ( ( a : Object ) => void ) | null = null ;
89
88
lastSessionId : string | null = null ;
90
89
91
- /** @private {number|null} */
92
90
private establishConnectionTimer_ : number | null = null ;
93
91
94
- /** @private {boolean} */
95
92
private visible_ : boolean = false ;
96
93
97
94
// Before we get connected, we keep a queue of pending messages to send.
98
95
private requestCBHash_ : { [ k : number ] : ( a : any ) => void } = { } ;
99
96
private requestNumber_ = 0 ;
100
97
101
- /** @private {?{
102
- * sendRequest(Object),
103
- * close()
104
- * }} */
105
98
private realtime_ : {
106
99
sendRequest ( a : Object ) : void ;
107
100
close ( ) : void ;
108
101
} | null = null ;
109
102
110
- /** @private {string|null} */
111
103
private authToken_ : string | null = null ;
112
104
private forceTokenRefresh_ = false ;
113
105
private invalidAuthTokenCount_ = 0 ;
@@ -116,26 +108,17 @@ export class PersistentConnection extends ServerActions {
116
108
private lastConnectionAttemptTime_ : number | null = null ;
117
109
private lastConnectionEstablishedTime_ : number | null = null ;
118
110
119
- /**
120
- * @private
121
- */
122
111
private static nextPersistentConnectionId_ = 0 ;
123
112
124
113
/**
125
114
* Counter for number of connections created. Mainly used for tagging in the logs
126
- * @type {number }
127
- * @private
128
115
*/
129
116
private static nextConnectionId_ = 0 ;
130
117
131
118
/**
132
119
* @implements {ServerActions}
133
- * @param {!RepoInfo } repoInfo_ Data about the namespace we are connecting to
134
- * @param {function(string, *, boolean, ?number) } onDataUpdate_ A callback for new data from the server
135
- * @param onConnectStatus_
136
- * @param onServerInfoUpdate_
137
- * @param authTokenProvider_
138
- * @param authOverride_
120
+ * @param repoInfo_ Data about the namespace we are connecting to
121
+ * @param onDataUpdate_ A callback for new data from the server
139
122
*/
140
123
constructor (
141
124
private repoInfo_ : RepoInfo ,
@@ -166,12 +149,6 @@ export class PersistentConnection extends ServerActions {
166
149
}
167
150
}
168
151
169
- /**
170
- * @param {!string } action
171
- * @param {* } body
172
- * @param {function(*)= } onResponse
173
- * @protected
174
- */
175
152
protected sendRequest (
176
153
action : string ,
177
154
body : any ,
@@ -226,13 +203,6 @@ export class PersistentConnection extends ServerActions {
226
203
}
227
204
}
228
205
229
- /**
230
- * @param {!{onComplete(),
231
- * hashFn():!string,
232
- * query: !Query,
233
- * tag: ?number}} listenSpec
234
- * @private
235
- */
236
206
private sendListen_ ( listenSpec : ListenSpec ) {
237
207
const query = listenSpec . query ;
238
208
const pathString = query . path . toString ( ) ;
@@ -274,11 +244,6 @@ export class PersistentConnection extends ServerActions {
274
244
} ) ;
275
245
}
276
246
277
- /**
278
- * @param {* } payload
279
- * @param {!Query } query
280
- * @private
281
- */
282
247
private static warnOnListenWarnings_ ( payload : any , query : Query ) {
283
248
if ( payload && typeof payload === 'object' && contains ( payload , 'w' ) ) {
284
249
const warnings = safeGet ( payload , 'w' ) ;
@@ -319,10 +284,6 @@ export class PersistentConnection extends ServerActions {
319
284
this . reduceReconnectDelayIfAdminCredential_ ( token ) ;
320
285
}
321
286
322
- /**
323
- * @param {!string } credential
324
- * @private
325
- */
326
287
private reduceReconnectDelayIfAdminCredential_ ( credential : string ) {
327
288
// NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client).
328
289
// Additionally, we don't bother resetting the max delay back to the default if auth fails / expires.
@@ -576,10 +537,6 @@ export class PersistentConnection extends ServerActions {
576
537
}
577
538
}
578
539
579
- /**
580
- * @param {* } message
581
- * @private
582
- */
583
540
private onDataMessage_ ( message : { [ k : string ] : any } ) {
584
541
if ( 'r' in message ) {
585
542
// this is a response
@@ -663,10 +620,6 @@ export class PersistentConnection extends ServerActions {
663
620
} , Math . floor ( timeout ) ) as any ;
664
621
}
665
622
666
- /**
667
- * @param {boolean } visible
668
- * @private
669
- */
670
623
private onVisible_ ( visible : boolean ) {
671
624
// NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine.
672
625
if (
@@ -819,9 +772,6 @@ export class PersistentConnection extends ServerActions {
819
772
}
820
773
}
821
774
822
- /**
823
- * @param {string } reason
824
- */
825
775
interrupt ( reason : string ) {
826
776
log ( 'Interrupting connection for reason: ' + reason ) ;
827
777
this . interruptReasons_ [ reason ] = true ;
@@ -838,9 +788,6 @@ export class PersistentConnection extends ServerActions {
838
788
}
839
789
}
840
790
841
- /**
842
- * @param {string } reason
843
- */
844
791
resume ( reason : string ) {
845
792
log ( 'Resuming connection for reason: ' + reason ) ;
846
793
delete this . interruptReasons_ [ reason ] ;
@@ -872,11 +819,6 @@ export class PersistentConnection extends ServerActions {
872
819
if ( this . outstandingPutCount_ === 0 ) this . outstandingPuts_ = [ ] ;
873
820
}
874
821
875
- /**
876
- * @param {!string } pathString
877
- * @param {Array.<*>= } query
878
- * @private
879
- */
880
822
private onListenRevoked_ ( pathString : string , query ?: any [ ] ) {
881
823
// Remove the listen and manufacture a "permission_denied" error for the failed listen.
882
824
let queryId ;
@@ -889,12 +831,6 @@ export class PersistentConnection extends ServerActions {
889
831
if ( listen && listen . onComplete ) listen . onComplete ( 'permission_denied' ) ;
890
832
}
891
833
892
- /**
893
- * @param {!string } pathString
894
- * @param {!string } queryId
895
- * @return {{queries:Array.<Query>, onComplete:function(string)} }
896
- * @private
897
- */
898
834
private removeListen_ ( pathString : string , queryId : string ) : ListenSpec {
899
835
const normalizedPathString = new Path ( pathString ) . toString ( ) ; // normalize path.
900
836
let listen ;
@@ -971,7 +907,6 @@ export class PersistentConnection extends ServerActions {
971
907
972
908
/**
973
909
* Sends client stats for first connection
974
- * @private
975
910
*/
976
911
private sendConnectStats_ ( ) {
977
912
const stats : { [ k : string ] : number } = { } ;
@@ -995,10 +930,6 @@ export class PersistentConnection extends ServerActions {
995
930
this . reportStats ( stats ) ;
996
931
}
997
932
998
- /**
999
- * @return {boolean }
1000
- * @private
1001
- */
1002
933
private shouldReconnect_ ( ) : boolean {
1003
934
const online = OnlineMonitor . getInstance ( ) . currentlyOnline ( ) ;
1004
935
return isEmpty ( this . interruptReasons_ ) && online ;
0 commit comments