Skip to content

Merge master into LRU branch #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// Ruler can't be specified via editorconfig
"editor.rulers": [80],
"editor.rulers": [100],

"search.exclude": {
// Exclude gulp build outputs from search results
Expand Down
2 changes: 1 addition & 1 deletion integration/browserify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "karma start --single-run"
},
"dependencies": {
"firebase": "5.5.0"
"firebase": "5.5.1"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
Expand Down
2 changes: 1 addition & 1 deletion integration/firebase-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "tsc index.ts --outDir dist"
},
"dependencies": {
"firebase": "5.5.0"
"firebase": "5.5.1"
},
"devDependencies": {
"typescript": "2.8.1"
Expand Down
2 changes: 1 addition & 1 deletion integration/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:manual": "mocha --exit"
},
"dependencies": {
"firebase": "5.5.0"
"firebase": "5.5.1"
},
"devDependencies": {
"chai": "4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion integration/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "karma start --single-run"
},
"dependencies": {
"firebase": "5.5.0"
"firebase": "5.5.1"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
Expand Down
2 changes: 1 addition & 1 deletion integration/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "karma start --single-run"
},
"dependencies": {
"firebase": "5.5.0"
"firebase": "5.5.1"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebase/auth",
"version": "0.7.5",
"version": "0.7.6",
"main": "dist/auth.js",
"module": "dist/auth.esm.js",
"description": "Javascript library for Firebase Auth SDK",
Expand Down
2 changes: 1 addition & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebase/database",
"version": "0.3.5",
"version": "0.3.6",
"description": "",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"main": "dist/index.node.cjs.js",
Expand Down
10 changes: 5 additions & 5 deletions packages/firebase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase",
"version": "5.5.0",
"version": "5.5.1",
"description": "Firebase JavaScript library for web and Node.js",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -36,10 +36,10 @@
"react-native": "dist/index.rn.cjs.js",
"dependencies": {
"@firebase/app": "0.3.4",
"@firebase/auth": "0.7.5",
"@firebase/database": "0.3.5",
"@firebase/firestore": "0.8.0",
"@firebase/functions": "0.3.0",
"@firebase/auth": "0.7.6",
"@firebase/database": "0.3.6",
"@firebase/firestore": "0.8.1",
"@firebase/functions": "0.3.1",
"@firebase/messaging": "0.3.6",
"@firebase/polyfill": "0.3.3",
"@firebase/storage": "0.2.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ const componentBuilds = components
globals: {
'@firebase/app': GLOBAL_NAME
},
intro: `try {`,
outro: `} catch(err) {
banner: `try {`,
footer: `} catch(err) {
console.error(err);
throw new Error(
'Cannot instantiate firebase-${component} - ' +
Expand Down
4 changes: 2 additions & 2 deletions packages/firestore/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebase/firestore",
"version": "0.8.0",
"version": "0.8.1",
"description": "",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"scripts": {
Expand All @@ -27,7 +27,7 @@
"dependencies": {
"@firebase/firestore-types": "0.7.0",
"@firebase/logger": "0.1.1",
"@firebase/webchannel-wrapper": "0.2.8",
"@firebase/webchannel-wrapper": "0.2.9",
"grpc": "1.13.1",
"tslib": "1.9.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/firestore/src/api/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import { FirebaseApp } from '@firebase/app-types';
import { _FirebaseApp } from '@firebase/app-types/private';
import { User } from '../auth/user';
import { assert } from '../util/assert';
import { Code, FirestoreError } from '../util/error';
import { FirebaseApp } from '@firebase/app-types';
import { _FirebaseApp } from '@firebase/app-types/private';

// TODO(mikelehen): This should be split into multiple files and probably
// moved to an auth/ folder to match other platforms.
Expand Down
11 changes: 6 additions & 5 deletions packages/firestore/src/api/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import * as firestore from '@firebase/firestore-types';

import { FirebaseApp } from '@firebase/app-types';
import { FirebaseService } from '@firebase/app-types/private';
import { FieldPath as ExternalFieldPath } from './field_path';
import { DatabaseId, DatabaseInfo } from '../core/database_info';
import { ListenOptions } from '../core/event_manager';
import { FirestoreClient } from '../core/firestore_client';
Expand Down Expand Up @@ -57,19 +56,20 @@ import {
validateBetweenNumberOfArgs,
validateDefined,
validateExactNumberOfArgs,
validateNamedOptionalType,
validateNamedOptionalPropertyEquals,
validateNamedOptionalType,
validateNamedType,
validateOptionalArgType,
validateOptionalArrayElements,
validateOptionNames,
valueDescription,
validateOptionalArrayElements
valueDescription
} from '../util/input_validation';
import * as log from '../util/log';
import { LogLevel } from '../util/log';
import { AnyJs, AutoId } from '../util/misc';
import * as objUtils from '../util/obj';
import { Rejecter, Resolver } from '../util/promise';
import { FieldPath as ExternalFieldPath } from './field_path';

import {
CredentialsProvider,
Expand Down Expand Up @@ -2076,7 +2076,8 @@ function validateSetOptions(
if (options.mergeFields !== undefined && options.merge !== undefined) {
throw new FirestoreError(
Code.INVALID_ARGUMENT,
`Invalid options passed to function ${methodName}(): You cannot specify both "merge" and "mergeFields".`
`Invalid options passed to function ${methodName}(): You cannot specify both "merge" ` +
`and "mergeFields".`
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/src/api/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { AnyJs } from '../util/misc';
import { JsonObject } from '../model/field_value';
import { AnyJs } from '../util/misc';

/**
* Observer/Subscribe interfaces.
Expand Down
16 changes: 8 additions & 8 deletions packages/firestore/src/api/user_data_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ import { Dict } from '../util/obj';
import { SortedMap } from '../util/sorted_map';
import * as typeUtils from '../util/types';

import {
ArrayRemoveTransformOperation,
ArrayUnionTransformOperation,
ServerTimestampTransform
} from '../model/transform_operation';
import { Blob } from './blob';
import {
FieldPath as ExternalFieldPath,
fromDotSeparatedString
} from './field_path';
import {
ArrayRemoveFieldValueImpl,
ArrayUnionFieldValueImpl,
DeleteFieldValueImpl,
FieldValueImpl,
ServerTimestampFieldValueImpl,
ArrayUnionFieldValueImpl,
ArrayRemoveFieldValueImpl
ServerTimestampFieldValueImpl
} from './field_value';
import { GeoPoint } from './geo_point';
import {
ServerTimestampTransform,
ArrayUnionTransformOperation,
ArrayRemoveTransformOperation
} from '../model/transform_operation';

const RESERVED_FIELD_REGEX = /^__.*__$/;

Expand Down
6 changes: 3 additions & 3 deletions packages/firestore/src/core/event_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

import { assert } from '../util/assert';
import { EventHandler } from '../util/misc';
import { ObjectMap } from '../util/obj_map';
import { Query } from './query';
import { SyncEngine, SyncEngineListener } from './sync_engine';
import { OnlineState, TargetId } from './types';
import { DocumentViewChange } from './view_snapshot';
import { ChangeType, ViewSnapshot } from './view_snapshot';
import { assert } from '../util/assert';
import { EventHandler } from '../util/misc';
import { ObjectMap } from '../util/obj_map';

/**
* Holds the listeners and the last received ViewSnapshot for a query being
Expand Down
30 changes: 15 additions & 15 deletions packages/firestore/src/core/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@

import { CredentialsProvider } from '../api/credentials';
import { User } from '../auth/user';
import {
EventManager,
ListenOptions,
Observer,
QueryListener
} from './event_manager';
import { SyncEngine } from './sync_engine';
import { View, ViewDocumentChanges } from './view';
import { EagerGarbageCollector } from '../local/eager_garbage_collector';
import { GarbageCollector } from '../local/garbage_collector';
import { IndexedDbPersistence } from '../local/indexeddb_persistence';
Expand All @@ -47,20 +39,28 @@ import { AsyncQueue } from '../util/async_queue';
import { Code, FirestoreError } from '../util/error';
import { debug } from '../util/log';
import { Deferred } from '../util/promise';
import {
EventManager,
ListenOptions,
Observer,
QueryListener
} from './event_manager';
import { SyncEngine } from './sync_engine';
import { View, ViewDocumentChanges } from './view';

import { DatabaseId, DatabaseInfo } from './database_info';
import { Query } from './query';
import { Transaction } from './transaction';
import { OnlineStateSource } from './types';
import { ViewSnapshot } from './view_snapshot';
import { PersistenceSettings } from '../api/database';
import {
MemorySharedClientState,
SharedClientState,
WebStorageSharedClientState
} from '../local/shared_client_state';
import { AutoId } from '../util/misc';
import { PersistenceSettings } from '../api/database';
import { assert } from '../util/assert';
import { AutoId } from '../util/misc';
import { DatabaseId, DatabaseInfo } from './database_info';
import { Query } from './query';
import { Transaction } from './transaction';
import { OnlineStateSource } from './types';
import { ViewSnapshot } from './view_snapshot';

const LOG_TAG = 'FirestoreClient';

Expand Down
7 changes: 4 additions & 3 deletions packages/firestore/src/core/listen_sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import { ListenSequenceNumber } from './types';

/**
* `SequenceNumberSyncer` defines the methods required to keep multiple instances of a `ListenSequence` in sync.
* `SequenceNumberSyncer` defines the methods required to keep multiple instances of a
* `ListenSequence` in sync.
*/
export interface SequenceNumberSyncer {
// Notify the syncer that a new sequence number has been used.
Expand All @@ -32,8 +33,8 @@ export interface SequenceNumberSyncer {
/**
* `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to
* exceed. All subsequent calls to next will return increasing values. If provided with a
* `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as well as write out
* sequence numbers that it produces via `next()`.
* `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as
* well as write out sequence numbers that it produces via `next()`.
*/
export class ListenSequence {
static readonly INVALID: ListenSequenceNumber = -1;
Expand Down
4 changes: 2 additions & 2 deletions packages/firestore/src/core/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import { Document } from '../model/document';
import { DocumentKey } from '../model/document_key';
import {
ArrayValue,
DoubleValue,
FieldValue,
NullValue,
RefValue,
ArrayValue
RefValue
} from '../model/field_value';
import { FieldPath, ResourcePath } from '../model/path';
import { assert, fail } from '../util/assert';
Expand Down
25 changes: 13 additions & 12 deletions packages/firestore/src/core/sync_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { PersistencePromise } from '../local/persistence_promise';
import { QueryData, QueryPurpose } from '../local/query_data';
import { ReferenceSet } from '../local/reference_set';
import {
MaybeDocumentMap,
documentKeySet,
DocumentKeySet
DocumentKeySet,
MaybeDocumentMap
} from '../model/collections';
import { MaybeDocument, NoDocument } from '../model/document';
import { DocumentKey } from '../model/document_key';
Expand All @@ -41,6 +41,15 @@ import { Deferred } from '../util/promise';
import { SortedMap } from '../util/sorted_map';
import { isNullOrUndefined } from '../util/types';

import { isPrimaryLeaseLostError } from '../local/indexeddb_persistence';
import { ClientId, SharedClientState } from '../local/shared_client_state';
import {
QueryTargetState,
SharedClientStateSyncer
} from '../local/shared_client_state_syncer';
import * as objUtils from '../util/obj';
import { SortedSet } from '../util/sorted_set';
import { ListenSequence } from './listen_sequence';
import { Query } from './query';
import { SnapshotVersion } from './snapshot_version';
import { TargetIdGenerator } from './target_id_generator';
Expand All @@ -61,15 +70,6 @@ import {
ViewDocumentChanges
} from './view';
import { ViewSnapshot } from './view_snapshot';
import {
SharedClientStateSyncer,
QueryTargetState
} from '../local/shared_client_state_syncer';
import { ClientId, SharedClientState } from '../local/shared_client_state';
import { SortedSet } from '../util/sorted_set';
import * as objUtils from '../util/obj';
import { isPrimaryLeaseLostError } from '../local/indexeddb_persistence';
import { ListenSequence } from './listen_sequence';

const LOG_TAG = 'SyncEngine';

Expand Down Expand Up @@ -246,7 +246,8 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
.remoteDocumentKeys(queryData.targetId)
.then(remoteKeys => {
const view = new View(query, remoteKeys);
const viewDocChanges = view.computeInitialChanges(docs);
const viewDocChanges = view.computeDocChanges(docs);
// tslint:disable-next-line:max-line-length Prettier formats this exceed 100 characters.
const synthesizedTargetChange = TargetChange.createSynthesizedTargetChangeForCurrentChange(
queryData.targetId,
current && this.onlineState !== OnlineState.Offline
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/src/core/target_id_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { TargetId } from './types';
import { assert } from '../util/assert';
import { TargetId } from './types';

const RESERVED_BITS = 1;

Expand Down
Loading