Skip to content

Commit 8406db5

Browse files
committed
WIP: fix merge conflicts
1 parent 9a00479 commit 8406db5

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/database/core/PersistentConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ export class PersistentConnection extends ServerActions {
817817
// Puts depend on having received the corresponding data update from the server before they complete, so we must
818818
// make sure to send listens before puts.
819819
forEach(this.listens_, (pathString: string, queries: Object) => {
820-
forEach(queries, function (key: string, listenSpec: ListenSpec) {
820+
forEach(queries, (key: string, listenSpec: ListenSpec) => {
821821
this.sendListen_(listenSpec);
822822
});
823823
});

src/database/core/Repo_transaction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export enum TransactionStatus {
5555
* @const
5656
* @private
5757
*/
58-
const MAX_TRANSACTION_RETRIES_ = 25;
59-
58+
(Repo as any).MAX_TRANSACTION_RETRIES_ = 25;
6059

6160
/**
6261
* @typedef {{
@@ -401,7 +400,7 @@ Repo.prototype.startTransaction = function (path: Path,
401400
abortReason = transaction.abortReason;
402401
events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));
403402
} else if (transaction.status === TransactionStatus.RUN) {
404-
if (transaction.retryCount >= MAX_TRANSACTION_RETRIES_) {
403+
if (transaction.retryCount >= (Repo as any).MAX_TRANSACTION_RETRIES_) {
405404
abortTransaction = true;
406405
abortReason = 'maxretry';
407406
events = events.concat(this.serverSyncTree_.ackUserWrite(transaction.currentWriteId, true));

tests/database/helpers/util.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,16 @@ export function getSnap(path) {
188188
path.once('value', callback);
189189
return snap;
190190
}
191+
191192
export function getVal(path) {
192193
const snap = getSnap(path);
193194
return snap ? snap.val() : undefined;
194195
}
196+
195197
export function canCreateExtraConnections() {
196198
return globalScope.MozWebSocket || globalScope.WebSocket;
197199
}
200+
198201
export function buildObjFromKey(key) {
199202
const keys = key.split('.');
200203
const obj = {};
@@ -206,10 +209,11 @@ export function buildObjFromKey(key) {
206209
}
207210
return obj;
208211
}
212+
209213
export function testRepoInfo(url) {
210-
const regex = /https:\/\/(.*).firebaseio.com/;
214+
const regex = /https?:\/\/(.*).firebaseio.com/;
211215
const match = url.match(regex);
212216
if (!match) throw new Error('Couldnt get Namespace from passed URL');
213217
const [,ns] = match;
214-
return new ConnectionTarget(`${ns}.firebaseio.com`, false, ns, false);
218+
return new ConnectionTarget(`${ns}.firebaseio.com`, true, ns, false);
215219
}

tests/database/repoinfo.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ describe('RepoInfo', function() {
1616
urlParams[VERSION_PARAM] = PROTOCOL_VERSION;
1717
urlParams[LAST_SESSION_PARAM] = 'test';
1818

19-
const websocketUrl = repoInfo.connectionURL(CONSTANTS.WEBSOCKET, urlParams);
19+
const websocketUrl = repoInfo.connectionURL(WEBSOCKET, urlParams);
2020
expect(websocketUrl).to.equal('wss://test-ns.firebaseio.com/.ws?v=5&ls=test');
2121

22-
const longPollingUrl = repoInfo.connectionURL(CONSTANTS.LONG_POLLING, urlParams);
22+
const longPollingUrl = repoInfo.connectionURL(LONG_POLLING, urlParams);
2323
expect(longPollingUrl).to.equal('https://test-ns.firebaseio.com/.lp?v=5&ls=test');
2424
});
2525
});

0 commit comments

Comments
 (0)