Skip to content

Commit 70dcaa7

Browse files
committed
Removed 4 characters from each error code
1 parent 448257f commit 70dcaa7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+174
-192
lines changed

packages/firestore/src/api/credentials.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export class LiteAuthCredentialsProvider implements CredentialsProvider<User> {
207207
if (tokenData) {
208208
hardAssert(
209209
typeof tokenData.accessToken === 'string',
210-
0xa539b8a7,
210+
0xa539,
211211
'Invalid tokenData returned from getToken()',
212212
{ tokenData }
213213
);
@@ -261,7 +261,7 @@ export class FirebaseAuthCredentialsProvider
261261
): void {
262262
hardAssert(
263263
this.tokenListener === undefined,
264-
0xa539b8a6,
264+
0xa539,
265265
'Token listener already added'
266266
);
267267
let lastTokenId = this.tokenCounter;
@@ -360,7 +360,7 @@ export class FirebaseAuthCredentialsProvider
360360
if (tokenData) {
361361
hardAssert(
362362
typeof tokenData.accessToken === 'string',
363-
0x7c5d2af1,
363+
0x7c5d,
364364
'Invalid tokenData returned from getToken()',
365365
{ tokenData }
366366
);
@@ -391,7 +391,7 @@ export class FirebaseAuthCredentialsProvider
391391
const currentUid = this.auth && this.auth.getUid();
392392
hardAssert(
393393
currentUid === null || typeof currentUid === 'string',
394-
0x0807a470,
394+
0x0807,
395395
'Received invalid UID',
396396
{ currentUid }
397397
);
@@ -520,7 +520,7 @@ export class FirebaseAppCheckTokenProvider
520520
): void {
521521
hardAssert(
522522
this.tokenListener === undefined,
523-
0x0db82ad2,
523+
0x0db8,
524524
'Token listener already added'
525525
);
526526

@@ -596,7 +596,7 @@ export class FirebaseAppCheckTokenProvider
596596
if (tokenResult) {
597597
hardAssert(
598598
typeof tokenResult.token === 'string',
599-
0xae0e832b,
599+
0xae0e,
600600
'Invalid tokenResult returned from getToken()',
601601
{ tokenResult }
602602
);
@@ -669,7 +669,7 @@ export class LiteAppCheckTokenProvider implements CredentialsProvider<string> {
669669
if (tokenResult) {
670670
hardAssert(
671671
typeof tokenResult.token === 'string',
672-
0x0d8ea95d,
672+
0x0d8e,
673673
'Invalid tokenResult returned from getToken()',
674674
{ tokenResult }
675675
);

packages/firestore/src/api/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ export function resultChangeType(type: ChangeType): DocumentChangeType {
749749
case ChangeType.Removed:
750750
return 'removed';
751751
default:
752-
return fail(0xf03d90cd, 'Unknown change type', { type });
752+
return fail(0xf03d, 'Unknown change type', { type });
753753
}
754754
}
755755

packages/firestore/src/core/component_provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class LruGcMemoryOfflineComponentProvider extends MemoryOfflineComponentP
197197
): Scheduler | null {
198198
hardAssert(
199199
this.persistence.referenceDelegate instanceof MemoryLruDelegate,
200-
0xb7434c0f,
200+
0xb743,
201201
'referenceDelegate is expected to be an instance of MemoryLruDelegate.'
202202
);
203203

packages/firestore/src/core/filter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class FieldFilter extends Filter {
168168
case Operator.GREATER_THAN_OR_EQUAL:
169169
return comparison >= 0;
170170
default:
171-
return fail(0xb8a2aab3, 'Unknown FieldFilter operator', {
171+
return fail(0xb8a2, 'Unknown FieldFilter operator', {
172172
operator: this.op
173173
});
174174
}
@@ -317,7 +317,7 @@ export function filterEquals(f1: Filter, f2: Filter): boolean {
317317
} else if (f1 instanceof CompositeFilter) {
318318
return compositeFilterEquals(f1, f2);
319319
} else {
320-
fail(0x4befcb45, 'Only FieldFilters and CompositeFilters can be compared');
320+
fail(0x4bef, 'Only FieldFilters and CompositeFilters can be compared');
321321
}
322322
}
323323

packages/firestore/src/core/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,6 @@ export function compareDocs(
578578
case Direction.DESCENDING:
579579
return -1 * comparison;
580580
default:
581-
return fail(0x4d4e3851, 'Unknown direction', { direction: orderBy.dir });
581+
return fail(0x4d4e, 'Unknown direction', { direction: orderBy.dir });
582582
}
583583
}

packages/firestore/src/core/sync_engine_impl.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,21 +579,21 @@ export async function syncEngineApplyRemoteEvent(
579579
targetChange.modifiedDocuments.size +
580580
targetChange.removedDocuments.size <=
581581
1,
582-
0x5858a197,
582+
0x5858,
583583
'Limbo resolution for single document contains multiple changes.'
584584
);
585585
if (targetChange.addedDocuments.size > 0) {
586586
limboResolution.receivedDocument = true;
587587
} else if (targetChange.modifiedDocuments.size > 0) {
588588
hardAssert(
589589
limboResolution.receivedDocument,
590-
0x390f2c8b,
590+
0x390f,
591591
'Received change for limbo target document without add.'
592592
);
593593
} else if (targetChange.removedDocuments.size > 0) {
594594
hardAssert(
595595
limboResolution.receivedDocument,
596-
0xa4f3c30e,
596+
0xa4f3,
597597
'Received remove for limbo target document without add.'
598598
);
599599
limboResolution.receivedDocument = false;
@@ -997,7 +997,7 @@ function updateTrackedLimbos(
997997
removeLimboTarget(syncEngineImpl, limboChange.key);
998998
}
999999
} else {
1000-
fail(0x4d4e3850, 'Unknown limbo change', { limboChange });
1000+
fail(0x4d4f, 'Unknown limbo change', { limboChange });
10011001
}
10021002
}
10031003
}
@@ -1320,7 +1320,7 @@ export async function syncEngineApplyBatchState(
13201320
batchId
13211321
);
13221322
} else {
1323-
fail(0x1a4018ac, `Unknown batchState`, { batchState });
1323+
fail(0x1a40, `Unknown batchState`, { batchState });
13241324
}
13251325

13261326
await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, documents);
@@ -1563,7 +1563,7 @@ export async function syncEngineApplyTargetState(
15631563
break;
15641564
}
15651565
default:
1566-
fail(0xfa9b528f, 'Unexpected target state', state);
1566+
fail(0xfa9b, 'Unexpected target state', state);
15671567
}
15681568
}
15691569
}

packages/firestore/src/core/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class Transaction {
124124
// Represent a deleted doc using SnapshotVersion.min().
125125
docVersion = SnapshotVersion.min();
126126
} else {
127-
throw fail(0xc542d4e0, 'Document in a transaction was a ', {
127+
throw fail(0xc542, 'Document in a transaction was a ', {
128128
documentName: doc.constructor.name
129129
});
130130
}

packages/firestore/src/core/view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ function compareChangeType(c1: ChangeType, c2: ChangeType): number {
505505
case ChangeType.Removed:
506506
return 0;
507507
default:
508-
return fail(0x4f35c22a, 'Unknown ChangeType', { change });
508+
return fail(0x4f35, 'Unknown ChangeType', { change });
509509
}
510510
};
511511

packages/firestore/src/core/view_snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class DocumentChangeSet {
118118
// Metadata->Added
119119
// Removed->Metadata
120120
fail(
121-
0xf76d356d,
121+
0xf76d,
122122
'unsupported combination of changes: `change` after `oldChange`',
123123
{
124124
change,

packages/firestore/src/index/firestore_index_value_writer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class FirestoreIndexValueWriter {
136136
this.writeIndexArray(indexValue.arrayValue!, encoder);
137137
this.writeTruncationMarker(encoder);
138138
} else {
139-
fail(0x4a4e16fa, 'unknown index value type', { indexValue });
139+
fail(0x4a4e, 'unknown index value type', { indexValue });
140140
}
141141
}
142142

packages/firestore/src/lite-api/reference_impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export function getDoc<AppModelType, DbModelType extends DocumentData>(
135135
result => {
136136
hardAssert(
137137
result.length === 1,
138-
0x3d02d4f4,
138+
0x3d02,
139139
'Expected a single document result'
140140
);
141141
const document = result[0];

packages/firestore/src/lite-api/transaction.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ export class Transaction {
9494
const userDataWriter = new LiteUserDataWriter(this._firestore);
9595
return this._transaction.lookup([ref._key]).then(docs => {
9696
if (!docs || docs.length !== 1) {
97-
return fail(
98-
0x5de91660,
99-
'Mismatch in docs returned from document lookup.'
100-
);
97+
return fail(0x5de9, 'Mismatch in docs returned from document lookup.');
10198
}
10299
const doc = docs[0];
103100
if (doc.isFoundDocument()) {
@@ -118,7 +115,7 @@ export class Transaction {
118115
);
119116
} else {
120117
throw fail(
121-
0x4801d4c1,
118+
0x4801,
122119
'BatchGetDocumentsRequest returned unexpected document',
123120
{
124121
doc

packages/firestore/src/lite-api/user_data_reader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function isWrite(dataSource: UserDataSource): boolean {
175175
case UserDataSource.ArrayArgument:
176176
return false;
177177
default:
178-
throw fail(0x9c4bc6ee, 'Unexpected case for UserDataSource', {
178+
throw fail(0x9c4b, 'Unexpected case for UserDataSource', {
179179
dataSource
180180
});
181181
}

packages/firestore/src/lite-api/user_data_writer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export abstract class AbstractUserDataWriter {
8989
case TypeOrder.VectorValue:
9090
return this.convertVectorValue(value.mapValue!);
9191
default:
92-
throw fail(0xf2a2c883, 'Invalid value type', {
92+
throw fail(0xf2a2, 'Invalid value type', {
9393
value
9494
});
9595
}
@@ -175,7 +175,7 @@ export abstract class AbstractUserDataWriter {
175175
const resourcePath = ResourcePath.fromString(name);
176176
hardAssert(
177177
isValidResourceName(resourcePath),
178-
0x25d8ba3b,
178+
0x25d8,
179179
'ReferenceValue is not valid',
180180
{ name }
181181
);

packages/firestore/src/local/encoded_resource_path.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath {
118118
// Event the empty path must encode as a path of at least length 2. A path
119119
// with exactly 2 must be the empty path.
120120
const length = path.length;
121-
hardAssert(length >= 2, 0xfb9852e0, 'Invalid path', { path });
121+
hardAssert(length >= 2, 0xfb98, 'Invalid path', { path });
122122
if (length === 2) {
123123
hardAssert(
124124
path.charAt(0) === escapeChar && path.charAt(1) === encodedSeparatorChar,
125-
0xdb51aee5,
125+
0xdb51,
126126
'Non-empty path had length 2',
127127
{ path }
128128
);
@@ -141,7 +141,7 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath {
141141
// there must be an end to this segment.
142142
const end = path.indexOf(escapeChar, start);
143143
if (end < 0 || end > lastReasonableEscapeIndex) {
144-
fail(0xc553d051, 'Invalid encoded resource path', { path });
144+
fail(0xc553, 'Invalid encoded resource path', { path });
145145
}
146146

147147
const next = path.charAt(end + 1);
@@ -169,7 +169,7 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath {
169169
segmentBuilder += path.substring(start, end + 1);
170170
break;
171171
default:
172-
fail(0xeeefd395, 'Invalid encoded resource path', { path });
172+
fail(0xeeef, 'Invalid encoded resource path', { path });
173173
}
174174

175175
start = end + 2;

packages/firestore/src/local/indexeddb_index_manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ export class IndexedDbIndexManager implements IndexManager {
10661066
this.getSubTargets(target),
10671067
(subTarget: Target) =>
10681068
this.getFieldIndex(transaction, subTarget).next(index =>
1069-
index ? index : fail(0xad8a2524, 'Target cannot be served from index')
1069+
index ? index : fail(0xad8a, 'Target cannot be served from index')
10701070
)
10711071
).next(getMinOffsetFromFieldIndexes);
10721072
}
@@ -1118,7 +1118,7 @@ function indexStateStore(
11181118
function getMinOffsetFromFieldIndexes(fieldIndexes: FieldIndex[]): IndexOffset {
11191119
hardAssert(
11201120
fieldIndexes.length !== 0,
1121-
0x709979b6,
1121+
0x7099,
11221122
'Found empty index group when looking for least recent index offset.'
11231123
);
11241124

packages/firestore/src/local/indexeddb_mutation_batch_impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function removeMutationBatch(
6464
removePromise.next(() => {
6565
hardAssert(
6666
numDeleted === 1,
67-
0xb7deb8ed,
67+
0xb7de,
6868
'Dangling document-mutation reference found: Missing batch',
6969
{ batchId: batch.batchId }
7070
);
@@ -101,7 +101,7 @@ export function dbDocumentSize(
101101
} else if (doc.noDocument) {
102102
value = doc.noDocument;
103103
} else {
104-
throw fail(0x398b459b, 'Unknown remote document type');
104+
throw fail(0x398b, 'Unknown remote document type');
105105
}
106106
return JSON.stringify(value).length;
107107
}

0 commit comments

Comments
 (0)