Skip to content

Commit ad23ddc

Browse files
committed
Remove redundant comments
1 parent dbbb2a4 commit ad23ddc

File tree

1 file changed

+2
-71
lines changed

1 file changed

+2
-71
lines changed

packages/database/src/core/PersistentConnection.ts

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export class PersistentConnection extends ServerActions {
7676
id = PersistentConnection.nextPersistentConnectionId_++;
7777
private log_ = logWrapper('p:' + this.id + ':');
7878

79-
/** @private {Object} */
8079
private interruptReasons_: { [reason: string]: boolean } = {};
8180
private listens_: { [path: string]: { [queryId: string]: ListenSpec } } = {};
8281
private outstandingPuts_: OutstandingPut[] = [];
@@ -88,26 +87,19 @@ export class PersistentConnection extends ServerActions {
8887
private securityDebugCallback_: ((a: Object) => void) | null = null;
8988
lastSessionId: string | null = null;
9089

91-
/** @private {number|null} */
9290
private establishConnectionTimer_: number | null = null;
9391

94-
/** @private {boolean} */
9592
private visible_: boolean = false;
9693

9794
// Before we get connected, we keep a queue of pending messages to send.
9895
private requestCBHash_: { [k: number]: (a: any) => void } = {};
9996
private requestNumber_ = 0;
10097

101-
/** @private {?{
102-
* sendRequest(Object),
103-
* close()
104-
* }} */
10598
private realtime_: {
10699
sendRequest(a: Object): void;
107100
close(): void;
108101
} | null = null;
109102

110-
/** @private {string|null} */
111103
private authToken_: string | null = null;
112104
private forceTokenRefresh_ = false;
113105
private invalidAuthTokenCount_ = 0;
@@ -116,26 +108,17 @@ export class PersistentConnection extends ServerActions {
116108
private lastConnectionAttemptTime_: number | null = null;
117109
private lastConnectionEstablishedTime_: number | null = null;
118110

119-
/**
120-
* @private
121-
*/
122111
private static nextPersistentConnectionId_ = 0;
123112

124113
/**
125114
* Counter for number of connections created. Mainly used for tagging in the logs
126-
* @type {number}
127-
* @private
128115
*/
129116
private static nextConnectionId_ = 0;
130117

131118
/**
132119
* @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
139122
*/
140123
constructor(
141124
private repoInfo_: RepoInfo,
@@ -166,12 +149,6 @@ export class PersistentConnection extends ServerActions {
166149
}
167150
}
168151

169-
/**
170-
* @param {!string} action
171-
* @param {*} body
172-
* @param {function(*)=} onResponse
173-
* @protected
174-
*/
175152
protected sendRequest(
176153
action: string,
177154
body: any,
@@ -226,13 +203,6 @@ export class PersistentConnection extends ServerActions {
226203
}
227204
}
228205

229-
/**
230-
* @param {!{onComplete(),
231-
* hashFn():!string,
232-
* query: !Query,
233-
* tag: ?number}} listenSpec
234-
* @private
235-
*/
236206
private sendListen_(listenSpec: ListenSpec) {
237207
const query = listenSpec.query;
238208
const pathString = query.path.toString();
@@ -274,11 +244,6 @@ export class PersistentConnection extends ServerActions {
274244
});
275245
}
276246

277-
/**
278-
* @param {*} payload
279-
* @param {!Query} query
280-
* @private
281-
*/
282247
private static warnOnListenWarnings_(payload: any, query: Query) {
283248
if (payload && typeof payload === 'object' && contains(payload, 'w')) {
284249
const warnings = safeGet(payload, 'w');
@@ -319,10 +284,6 @@ export class PersistentConnection extends ServerActions {
319284
this.reduceReconnectDelayIfAdminCredential_(token);
320285
}
321286

322-
/**
323-
* @param {!string} credential
324-
* @private
325-
*/
326287
private reduceReconnectDelayIfAdminCredential_(credential: string) {
327288
// NOTE: This isn't intended to be bulletproof (a malicious developer can always just modify the client).
328289
// 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 {
576537
}
577538
}
578539

579-
/**
580-
* @param {*} message
581-
* @private
582-
*/
583540
private onDataMessage_(message: { [k: string]: any }) {
584541
if ('r' in message) {
585542
// this is a response
@@ -663,10 +620,6 @@ export class PersistentConnection extends ServerActions {
663620
}, Math.floor(timeout)) as any;
664621
}
665622

666-
/**
667-
* @param {boolean} visible
668-
* @private
669-
*/
670623
private onVisible_(visible: boolean) {
671624
// NOTE: Tabbing away and back to a window will defeat our reconnect backoff, but I think that's fine.
672625
if (
@@ -819,9 +772,6 @@ export class PersistentConnection extends ServerActions {
819772
}
820773
}
821774

822-
/**
823-
* @param {string} reason
824-
*/
825775
interrupt(reason: string) {
826776
log('Interrupting connection for reason: ' + reason);
827777
this.interruptReasons_[reason] = true;
@@ -838,9 +788,6 @@ export class PersistentConnection extends ServerActions {
838788
}
839789
}
840790

841-
/**
842-
* @param {string} reason
843-
*/
844791
resume(reason: string) {
845792
log('Resuming connection for reason: ' + reason);
846793
delete this.interruptReasons_[reason];
@@ -872,11 +819,6 @@ export class PersistentConnection extends ServerActions {
872819
if (this.outstandingPutCount_ === 0) this.outstandingPuts_ = [];
873820
}
874821

875-
/**
876-
* @param {!string} pathString
877-
* @param {Array.<*>=} query
878-
* @private
879-
*/
880822
private onListenRevoked_(pathString: string, query?: any[]) {
881823
// Remove the listen and manufacture a "permission_denied" error for the failed listen.
882824
let queryId;
@@ -889,12 +831,6 @@ export class PersistentConnection extends ServerActions {
889831
if (listen && listen.onComplete) listen.onComplete('permission_denied');
890832
}
891833

892-
/**
893-
* @param {!string} pathString
894-
* @param {!string} queryId
895-
* @return {{queries:Array.<Query>, onComplete:function(string)}}
896-
* @private
897-
*/
898834
private removeListen_(pathString: string, queryId: string): ListenSpec {
899835
const normalizedPathString = new Path(pathString).toString(); // normalize path.
900836
let listen;
@@ -971,7 +907,6 @@ export class PersistentConnection extends ServerActions {
971907

972908
/**
973909
* Sends client stats for first connection
974-
* @private
975910
*/
976911
private sendConnectStats_() {
977912
const stats: { [k: string]: number } = {};
@@ -995,10 +930,6 @@ export class PersistentConnection extends ServerActions {
995930
this.reportStats(stats);
996931
}
997932

998-
/**
999-
* @return {boolean}
1000-
* @private
1001-
*/
1002933
private shouldReconnect_(): boolean {
1003934
const online = OnlineMonitor.getInstance().currentlyOnline();
1004935
return isEmpty(this.interruptReasons_) && online;

0 commit comments

Comments
 (0)