## Description

Tag asserts for 2.1.

This is a bit early so will likely have to be done again just before the
release, but this gets the number of changes and thus reviewer groups
required for that more time sensitive change lower.
This commit is contained in:
Craig Macomber (Microsoft) 2024-07-19 11:59:47 -07:00 коммит произвёл GitHub
Родитель c415bf5eac
Коммит ef56f73ba3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
26 изменённых файлов: 130 добавлений и 70 удалений

Просмотреть файл

@ -28,7 +28,7 @@ export function computeHierarchicalOrdinal(
} else {
// eslint-disable-next-line unicorn/prefer-code-point
const prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);
assert(prevOrdCode !== undefined, "previous ordinal should not be empty");
assert(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);
const localOrdinal = prevOrdCode + ordinalWidth;
// eslint-disable-next-line unicorn/prefer-code-point
ordinal = parentOrdinal + String.fromCharCode(localOrdinal);

Просмотреть файл

@ -62,7 +62,7 @@ export function initializeForest(
const delta: DeltaRoot = deltaForRootInitialization(content);
let visitor = forest.acquireVisitor();
if (visitAnchors) {
assert(forest.anchors.isEmpty(), "anchor set must be empty");
assert(forest.anchors.isEmpty(), 0x9b7 /* anchor set must be empty */);
const anchorVisitor = forest.anchors.acquireVisitor();
visitor = combineVisitors([visitor, anchorVisitor], [anchorVisitor]);
}

Просмотреть файл

@ -140,7 +140,10 @@ export class DetachedFieldIndex {
nodeId.major,
nodeId.minor,
);
assert(entry !== undefined, "Inconsistent data: missing detached node entry");
assert(
entry !== undefined,
0x9b8 /* Inconsistent data: missing detached node entry */,
);
setInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor, {
...entry,
latestRelevantRevision: updated,
@ -175,7 +178,7 @@ export class DetachedFieldIndex {
);
assert(
entryInLatest !== undefined,
"Inconsistent data: missing node entry in latestRelevantRevision",
0x9b9 /* Inconsistent data: missing node entry in latestRelevantRevision */,
);
entryInLatest.set(entry.root, { major: updated, minor });
}
@ -235,13 +238,13 @@ export class DetachedFieldIndex {
detachedNodeId.major,
detachedNodeId.minor,
);
assert(found, "Unable to delete unknown entry");
assert(found, 0x9ba /* Unable to delete unknown entry */);
}
}
public deleteEntry(nodeId: Delta.DetachedNodeId): void {
const entry = tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);
assert(entry !== undefined, "Unable to delete unknown entry");
assert(entry !== undefined, 0x9bb /* Unable to delete unknown entry */);
deleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);
deleteFromNestedMap(
this.latestRelevantRevisionToFields,
@ -291,7 +294,7 @@ export class DetachedFieldIndex {
const fieldEntry = tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);
assert(
fieldEntry !== undefined,
"detached node id does not exist in the detached field index",
0x9bc /* detached node id does not exist in the detached field index */,
);
const { root, latestRelevantRevision: previousRevision } = fieldEntry;
@ -342,7 +345,7 @@ export class DetachedFieldIndex {
public setRevisionsForLoadedData(latestRevision: RevisionTag): void {
assert(
!this.isFullyLoaded,
"revisions should only be set once using this function after loading data from a summary",
0x9bd /* revisions should only be set once using this function after loading data from a summary */,
);
const newDetachedNodeToField = new Map();

Просмотреть файл

@ -147,7 +147,7 @@ export function getAllowedContentIncompatibilities(
const storedNodeSchema = stored.nodeSchema.get(key);
assert(
storedNodeSchema !== undefined,
"The storedNodeSchema in stored.nodeSchema should not be undefined",
0x9be /* The storedNodeSchema in stored.nodeSchema should not be undefined */,
);
if (storedNodeSchema instanceof MapNodeStoredSchema) {
incompatibilities.push({
@ -188,7 +188,7 @@ export function getAllowedContentIncompatibilities(
const storedNodeSchema = stored.nodeSchema.get(key);
assert(
storedNodeSchema !== undefined,
"The storedNodeSchema in stored.nodeSchema should not be undefined",
0x9bf /* The storedNodeSchema in stored.nodeSchema should not be undefined */,
);
if (storedNodeSchema instanceof ObjectNodeStoredSchema) {
incompatibilities.push({
@ -228,7 +228,7 @@ export function getAllowedContentIncompatibilities(
const storedNodeSchema = stored.nodeSchema.get(key);
assert(
storedNodeSchema !== undefined,
"The storedNodeSchema in stored.nodeSchema should not be undefined",
0x9c0 /* The storedNodeSchema in stored.nodeSchema should not be undefined */,
);
if (storedNodeSchema instanceof MapNodeStoredSchema) {
incompatibilities.push({

Просмотреть файл

@ -511,6 +511,6 @@ function getChangeHandler(
}
const handler = fieldKinds.get(fieldKind)?.kind.changeHandler;
assert(handler !== undefined, "Unknown field kind");
assert(handler !== undefined, 0x9c1 /* Unknown field kind */);
return handler;
}

Просмотреть файл

@ -1024,7 +1024,10 @@ export class ModularChangeFamily
baseNodeId,
).get(fieldKey);
assert(baseFieldChange !== undefined, "Cross field key registered for empty field");
assert(
baseFieldChange !== undefined,
0x9c2 /* Cross field key registered for empty field */,
);
if (crossFieldTable.baseFieldToContext.has(baseFieldChange)) {
// This field has already been processed because there were changes to rebase.
continue;
@ -1037,7 +1040,7 @@ export class ModularChangeFamily
baseChild: NodeId | undefined,
stateChange: NodeAttachState | undefined,
): NodeId | undefined => {
assert(child === undefined, "There should be no new changes in this field");
assert(child === undefined, 0x9c3 /* There should be no new changes in this field */);
return undefined;
};
@ -1109,7 +1112,7 @@ export class ModularChangeFamily
return;
}
assert(!rebasedNode.fieldChanges.has(fieldKey), "Expected an empty field");
assert(!rebasedNode.fieldChanges.has(fieldKey), 0x9c4 /* Expected an empty field */);
rebasedNode.fieldChanges.set(fieldKey, rebasedField);
return;
}
@ -2233,7 +2236,7 @@ class InvertManager extends CrossFieldManagerI<FieldChange> {
id: ChangesetLocalId,
count: number,
): void {
assert(false, "Keys should not be moved manually during invert");
assert(false, 0x9c5 /* Keys should not be moved manually during invert */);
}
private get table(): InvertTable {
@ -2269,7 +2272,7 @@ class RebaseManager extends CrossFieldManagerI<FieldChange> {
assert(
newFieldIds.length === 0,
"TODO: Modifying a cross-field key from the new changeset is currently unsupported",
0x9c6 /* TODO: Modifying a cross-field key from the new changeset is currently unsupported */,
);
const baseFieldIds = getFieldsForCrossFieldKey(this.table.baseChange, [
@ -2279,7 +2282,10 @@ class RebaseManager extends CrossFieldManagerI<FieldChange> {
count,
]);
assert(baseFieldIds.length > 0, "Cross field key not registered in base or new change");
assert(
baseFieldIds.length > 0,
0x9c7 /* Cross field key not registered in base or new change */,
);
for (const baseFieldId of baseFieldIds) {
this.table.affectedBaseFields.set(
@ -2356,7 +2362,7 @@ class ComposeManager extends CrossFieldManagerI<FieldChange> {
assert(
baseFieldIds.length > 0,
"Cross field key not registered in base or new change",
0x9c8 /* Cross field key not registered in base or new change */,
);
for (const baseFieldId of baseFieldIds) {
@ -2798,7 +2804,7 @@ function fieldMapFromNodeId(
}
const node = nodeChangeFromId(nodes, nodeId);
assert(node.fieldChanges !== undefined, "Expected node to have field changes");
assert(node.fieldChanges !== undefined, 0x9c9 /* Expected node to have field changes */);
return node.fieldChanges;
}
@ -2816,7 +2822,7 @@ function rebasedNodeIdFromBaseNodeId(table: RebaseTable, baseId: NodeId): NodeId
function nodeChangeFromId(nodes: ChangeAtomIdMap<NodeChangeset>, id: NodeId): NodeChangeset {
const node = getFromChangeAtomIdMap(nodes, id);
assert(node !== undefined, "Unknown node ID");
assert(node !== undefined, 0x9ca /* Unknown node ID */);
return node;
}
@ -2850,7 +2856,7 @@ function replaceFieldIdRevision(
export function getParentFieldId(changeset: ModularChangeset, nodeId: NodeId): FieldId {
const parentId = getFromChangeAtomIdMap(changeset.nodeToParent, nodeId);
assert(parentId !== undefined, "Parent field should be defined");
assert(parentId !== undefined, 0x9cb /* Parent field should be defined */);
return normalizeFieldId(parentId, changeset.nodeAliases);
}

Просмотреть файл

@ -429,7 +429,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
// after a transaction is rolled back, revert removed roots back to the latest snapshot
branch.on("transactionRolledBack", () => {
const snapshot = this.removedRootsSnapshots.pop();
assert(snapshot !== undefined, "a snapshot for removed roots does not exist");
assert(snapshot !== undefined, 0x9ae /* a snapshot for removed roots does not exist */);
this.removedRoots = snapshot;
});
@ -617,7 +617,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
this.checkNotDisposed();
assert(
!view.transaction.inProgress(),
"A view cannot be rebased while it has a pending transaction",
0x9af /* A view cannot be rebased while it has a pending transaction */,
);
view.branch.rebaseOnto(this.branch);
}
@ -633,7 +633,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
this.checkNotDisposed();
assert(
!this.transaction.inProgress(),
"Views cannot be merged into a view while it has a pending transaction",
0x9b0 /* Views cannot be merged into a view while it has a pending transaction */,
);
while (view.transaction.inProgress()) {
view.transaction.commit();

Просмотреть файл

@ -200,7 +200,7 @@ export function createKernel(node: TreeNode): void {
export function getKernel(node: TreeNode): TreeNodeKernel {
const kernel = treeNodeToKernel.get(node);
assert(kernel !== undefined, "Expected tree node to have kernel");
assert(kernel !== undefined, 0x9b1 /* Expected tree node to have kernel */);
return kernel;
}
@ -208,7 +208,7 @@ export function tryDisposeTreeNode(anchorNode: AnchorNode): void {
const treeNode = anchorNode.slots.get(proxySlot);
if (treeNode !== undefined) {
const kernel = treeNodeToKernel.get(treeNode);
assert(kernel !== undefined, "Expected tree node to have kernel");
assert(kernel !== undefined, 0x9b2 /* Expected tree node to have kernel */);
kernel.dispose();
}
}

Просмотреть файл

@ -165,7 +165,10 @@ export function walkNodeSchema(
walkAllowedTypes(field.allowedTypeSet, visitor, visitedSet);
}
} else {
assert(schema.kind === NodeKind.Array || schema.kind === NodeKind.Map, "invalid schema");
assert(
schema.kind === NodeKind.Array || schema.kind === NodeKind.Map,
0x9b3 /* invalid schema */,
);
const childTypes = schema.info as ImplicitAllowedTypes;
walkFieldSchema(childTypes, visitor, visitedSet);
}

Просмотреть файл

@ -68,7 +68,7 @@ export class TreeNodeKernel implements Listenable<TreeChangeEvents> {
// TODO: Replace this check with the proper check against the cursor state when the cursor becomes part of the kernel
const flex = this.#hydrated.anchorNode.slots.get(flexTreeSlot);
if (flex !== undefined) {
assert(flex instanceof LazyEntity, "Unexpected flex node implementation");
assert(flex instanceof LazyEntity, 0x9b4 /* Unexpected flex node implementation */);
if (flex[isFreedSymbol]()) {
return TreeStatus.Deleted;
}

Просмотреть файл

@ -315,7 +315,7 @@ export abstract class TreeNodeValid<TInput> extends TreeNode {
schemaBase.constructorCached = { constructor: this, oneTimeInitialized: false };
assert(
this.constructorCached === schemaBase.constructorCached,
"Inheritance should work",
0x9b5 /* Inheritance should work */,
);
return this.constructorCached;
} else if (this.constructorCached.constructor === this) {

Просмотреть файл

@ -79,7 +79,7 @@ export class Breakable {
* This is pretty much only safe in tests which just were checking a specific error was thrown, and which know that error closepath is actually exception safe.
*/
public clearError(): void {
assert(this.brokenBy !== undefined, "No error to clear");
assert(this.brokenBy !== undefined, 0x9b6 /* No error to clear */);
this.brokenBy = undefined;
}
}

Просмотреть файл

@ -150,7 +150,7 @@ function convertSummaryToSnapshotTreeForCreateNew(summary: ISummaryTree): IOdspS
const keys = Object.keys(summary.tree);
for (const key of keys) {
assert(!key.includes("/"), "id should not include slashes");
assert(!key.includes("/"), 0x9cc /* id should not include slashes */);
// Non null asserting for now this should change to Object.entries
const summaryObject = summary.tree[key]!;

Просмотреть файл

@ -179,7 +179,7 @@ export class OdspSummaryUploadManager {
let blobs = 0;
const keys = Object.keys(tree.tree);
for (const key of keys) {
assert(!key.includes("/"), "id should not include slashes");
assert(!key.includes("/"), 0x9cd /* id should not include slashes */);
// Non null asserting for now, this should be changed to Object.entries
const summaryObject = tree.tree[key]!;

Просмотреть файл

@ -362,7 +362,7 @@ async function getBlobManagerTreeFromTree(
storage: Pick<IDocumentStorageService, "readBlob">,
): Promise<void> {
const id = tree.blobs[redirectTableBlobName];
assert(id !== undefined, "id is undefined in getBlobManagerTreeFromTree");
assert(id !== undefined, 0x9ce /* id is undefined in getBlobManagerTreeFromTree */);
const blob = await storage.readBlob(id);
// ArrayBufferLike will not survive JSON.stringify()
blobs[id] = bufferToString(blob, "utf8");
@ -405,7 +405,10 @@ function getBlobManagerTreeFromTreeWithBlobContents(
blobs: ISerializableBlobContents,
): void {
const id = tree.blobs[redirectTableBlobName];
assert(id !== undefined, "id is undefined in getBlobManagerTreeFromTreeWithBlobContents");
assert(
id !== undefined,
0x9cf /* id is undefined in getBlobManagerTreeFromTreeWithBlobContents */,
);
const blob = tree.blobsContents?.[id];
assert(blob !== undefined, 0x70f /* Blob must be present in blobsContents */);
// ArrayBufferLike will not survive JSON.stringify()

Просмотреть файл

@ -4336,7 +4336,7 @@ export class ContainerRuntime
fetchSource: FetchSource.noCache,
});
const id = snapshot.snapshotTree.id;
assert(id !== undefined, "id of the fetched snapshot should be defined");
assert(id !== undefined, 0x9d0 /* id of the fetched snapshot should be defined */);
props.snapshotVersion = id;
snapshotTree = snapshot.snapshotTree;
} else {

Просмотреть файл

@ -156,7 +156,10 @@ const addBatchMetadata = (batch: IBatch, batchId?: BatchId): IBatch => {
const firstMsg = batch.messages[0];
const lastMsg = batch.messages[batchEnd];
assert(firstMsg !== undefined && lastMsg !== undefined, "expected non-empty batch");
assert(
firstMsg !== undefined && lastMsg !== undefined,
0x9d1 /* expected non-empty batch */,
);
const firstMetadata: Partial<IBatchMetadata> = firstMsg.metadata ?? {};
const lastMetadata: Partial<IBatchMetadata> = lastMsg.metadata ?? {};

Просмотреть файл

@ -298,7 +298,7 @@ export class Outbox {
clientSequenceNumber = this.sendBatch(processedBatch);
assert(
clientSequenceNumber === undefined || clientSequenceNumber >= 0,
"unexpected negative clientSequenceNumber (empty batch should yield undefined)",
0x9d2 /* unexpected negative clientSequenceNumber (empty batch should yield undefined) */,
);
}

Просмотреть файл

@ -105,10 +105,13 @@ export class RemoteMessageProcessor {
if (isGroupedBatch(message)) {
// We should be awaiting a new batch (batchStartCsn undefined)
assert(this.batchStartCsn === undefined, "Grouped batch interrupting another batch");
assert(
this.batchStartCsn === undefined,
0x9d3 /* Grouped batch interrupting another batch */,
);
assert(
this.processorBatch.length === 0,
"Processor batch should be empty on grouped batch",
0x9d4 /* Processor batch should be empty on grouped batch */,
);
return {
messages: this.opGroupingManager.ungroupOp(message).map(unpack),
@ -147,7 +150,7 @@ export class RemoteMessageProcessor {
const batchMetadataFlag = asBatchMetadata(message.metadata)?.batch;
if (this.batchStartCsn === undefined) {
// We are waiting for a new batch
assert(batchMetadataFlag !== false, "Unexpected batch end marker");
assert(batchMetadataFlag !== false, 0x9d5 /* Unexpected batch end marker */);
// Start of a new multi-message batch
if (batchMetadataFlag === true) {
@ -163,7 +166,7 @@ export class RemoteMessageProcessor {
// We are in the middle or end of an existing multi-message batch. Return the current batchStartCsn
const batchStartCsn = this.batchStartCsn;
assert(batchMetadataFlag !== true, "Unexpected batch start marker");
assert(batchMetadataFlag !== true, 0x9d6 /* Unexpected batch start marker */);
if (batchMetadataFlag === false) {
// Batch end? Then get ready for the next batch to start
this.batchStartCsn = undefined;

Просмотреть файл

@ -48,7 +48,7 @@ export class ChannelStorageService implements IChannelStorageService {
public async readBlob(path: string): Promise<ArrayBufferLike> {
const id = await this.getIdForPath(path);
assert(id !== undefined, "id is undefined in ChannelStorageService.readBlob()");
assert(id !== undefined, 0x9d7 /* id is undefined in ChannelStorageService.readBlob() */);
const blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;
if (blob !== undefined) {

Просмотреть файл

@ -700,7 +700,7 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
const sessionArray = sessions[sessionIndex + sessionOffset];
assert(
sessionArray !== undefined,
"sessionArray is undefined in IdCompressor.deserialize2_0",
0x9d8 /* sessionArray is undefined in IdCompressor.deserialize2_0 */,
);
const session = sessionArray[1];
const capacity = readNumber(index);

Просмотреть файл

@ -43,16 +43,16 @@ export interface Index {
export function readNumber(index: Index): number {
const value = index.bufferFloat[index.index];
assert(value !== undefined, "value is undefined in readNumber");
assert(value !== undefined, 0x9d9 /* value is undefined in readNumber */);
index.index += 1;
return value;
}
export function readNumericUuid(index: Index): NumericUuid {
const lowerHalf = index.bufferUint[index.index];
assert(lowerHalf !== undefined, "lowerHalf is undefined in readNumericUuid");
assert(lowerHalf !== undefined, 0x9da /* lowerHalf is undefined in readNumericUuid */);
const upperHalf = index.bufferUint[index.index + 1];
assert(upperHalf !== undefined, "upperHalf is undefined in readNumericUuid");
assert(upperHalf !== undefined, 0x9db /* upperHalf is undefined in readNumericUuid */);
const value = (upperHalf << sixtyFour) | lowerHalf;
index.index += 2;
return value as NumericUuid;

Просмотреть файл

@ -77,7 +77,7 @@ export class SessionSpaceNormalizer {
}
assert(
ranges[0] !== undefined,
"ranges[0] is undefined in SessionSpaceNormalizer.getRangesBetween",
0x9dd /* ranges[0] is undefined in SessionSpaceNormalizer.getRangesBetween */,
);
// now we touch up the first and last ranges to ensure that if they contain the
@ -100,7 +100,7 @@ export class SessionSpaceNormalizer {
const lastRange = ranges[lastRangeIndex];
assert(
lastRange !== undefined,
"lastRange is undefined in SessionSpaceNormalizer.getRangesBetween",
0x9de /* lastRange is undefined in SessionSpaceNormalizer.getRangesBetween */,
);
const [limitGenCount, limitCount] = lastRange;
if (this.rangeContains(lastRange, lastGenCount)) {

Просмотреть файл

@ -281,7 +281,7 @@ export class Session {
while (left <= right) {
const mid = Math.floor((left + right) / 2);
const value = arr[mid];
assert(value !== undefined, "value is undefined in Session.binarySearch");
assert(value !== undefined, 0x9dc /* value is undefined in Session.binarySearch */);
const c = comparator(search, value);
if (c === 0) {
return value; // Found the target, return its index.

Просмотреть файл

@ -153,7 +153,6 @@ export const shortCodeMap = {
"0x0b9": "PathName should exist",
"0x0ba": "Tenant id should exist",
"0x0bb": "Document id should exist",
"0x0bd": "Object runtime already has DataObject!",
"0x0be": "Trying to initialize from existing while initProps is set!",
"0x0bf": "set called recursively from the interception callback",
"0x0c0": "set called recursively from the interception callback",
@ -177,7 +176,6 @@ export const shortCodeMap = {
"0x0e3": "Newly set op handler is null/undefined!",
"0x0e4": "Lost old connection!",
"0x0e6": "old connection exists on new connection setup",
"0x0e7": "claims/connectionMode mismatch",
"0x0e8": "readonly perf with write connection",
"0x0e9": "messageBuffer is not empty on new connection",
"0x0eb": "Missing connection for reconnect",
@ -340,6 +338,7 @@ export const shortCodeMap = {
"0x1de": "Not an ODSP resolved url",
"0x1e2": "Caller must ensure 'isAttached()' before calling 'sendSetCellOp'.",
"0x1e4": "Unexpected serializable type",
"0x1e5": "Storage token should not be null",
"0x1e6": "Epoch should be present in response",
"0x1e7": "caching was not performed!",
"0x1e8": "reentrancy",
@ -405,7 +404,6 @@ export const shortCodeMap = {
"0x251": "creation summary has to have seq=0 && handle === undefined",
"0x252": "redirect table can only be set in detached container",
"0x254": "unrecognized id in redirect table",
"0x256": "storage undefined in attached container",
"0x257": "This is not summarizing container",
"0x258": "connected",
"0x25b": "Caller is responsible for checking lock",
@ -467,6 +465,7 @@ export const shortCodeMap = {
"0x2b5": "logic error",
"0x2b8": "Chunk should be set in map",
"0x2ba": "batchBegin must fire before batchEnd",
"0x2bc": "Instrumented token fetcher with throwOnNullToken =true should never return null",
"0x2be": "LocalReferences array contains a gap",
"0x2bf": "both removedClientIds and removedSeq should be set or not set",
"0x2c0": "ID must be created before adding interval to collection",
@ -595,6 +594,7 @@ export const shortCodeMap = {
"0x3cc": "reentrancy",
"0x3cd": "Connection is possible only if container exists in storage",
"0x3cf": "reentrancy",
"0x3d0": "clientSequenceNumber can't be negative",
"0x3d1": "Can't trigger summary in the middle of a batch",
"0x3d2": "Non-attached container is dirty",
"0x3d3": "if doc is dirty, there has to be pending ops",
@ -860,7 +860,6 @@ export const shortCodeMap = {
"0x5aa": "subdirectory should exist after creation",
"0x5ad": "Cannot change the markerId of an existing marker",
"0x5b0": "parent must exist",
"0x5b6": "This field should not have any base changes",
"0x5b9": "Cannot exit inexistent transaction",
"0x5bb": "Must be attached to run GC",
"0x5bc": "Must be attached to run GC",
@ -881,7 +880,6 @@ export const shortCodeMap = {
"0x5db": "Used route should always be an absolute route",
"0x5dc": "This should have be initialized when generate GC nodes above",
"0x5dd": "cannot group ops with metadata",
"0x5de": "unexpected op metadata",
"0x5df": "Summarize should not be called when not tracking the summary",
"0x5e0": "Used route should always be an absolute route",
"0x5e1": "interval ID should not be undefined",
@ -1047,7 +1045,6 @@ export const shortCodeMap = {
"0x6dc": "visitor expected to be defined",
"0x6dd": "pathA expected to be defined",
"0x6de": "pathB expected to be defined",
"0x6e1": "Encountered duplicate node key",
"0x6e4": "Runtime IdCompressor must be available to generate local node keys",
"0x6e5": "Runtime IdCompressor must be available to convert node keys",
"0x6e6": "Runtime IdCompressor must be available to convert node keys",
@ -1074,7 +1071,6 @@ export const shortCodeMap = {
"0x702": "\"BaseProperty\" shall not be used in schemas.",
"0x70e": "segment group must exist in pending list",
"0x70f": "Blob must be present in blobsContents",
"0x710": "A view that is merged into an in-progress transaction must be disposed",
"0x712": "name collision for nodePropertyField",
"0x713": "Expected change sequence number to exceed the last known minimum sequence number",
"0x716": "only never trees have undefined schema",
@ -1147,8 +1143,6 @@ export const shortCodeMap = {
"0x77a": "It is invalid to access a FlexTree node which no longer exists",
"0x77b": "must be in fields mode",
"0x77c": "Narrowing must be done to a kind that exists in this context",
"0x77d": "Content from different flex trees should not be used together",
"0x77e": "parentAnchorNode must exist.",
"0x780": "value field content should normalize to one item",
"0x781": "optional field content should normalize at most one item",
"0x782": "contexts must match",
@ -1181,7 +1175,6 @@ export const shortCodeMap = {
"0x7a8": "should be in fields",
"0x7a9": "Collision during index update",
"0x7aa": "Unknown removed node ID",
"0x7ab": "Unable to delete unknown entry",
"0x7af": "Destination must be a new empty detached field",
"0x7b0": "Replace detached source field and detached destination field must be different",
"0x7b1": "Unsupported sequence implementation.",
@ -1431,7 +1424,6 @@ export const shortCodeMap = {
"0x90f": "Attempted to apply \"nodeExists\" constraint when building a transaction, but the node is not in the document.",
"0x911": "Invalid operation on a disposed TreeCheckout",
"0x916": "invalid value",
"0x91a": "identifier must exist",
"0x91b": "node without schema",
"0x91c": "Proxy anchor should not be set twice",
"0x91d": "Cannot associate a flex node with multiple targets",
@ -1452,13 +1444,10 @@ export const shortCodeMap = {
"0x92d": "Expected LazyTreeNode",
"0x92e": "Unknown node ID",
"0x92f": "Should not have two changesets to compose",
"0x930": "Unknown node ID",
"0x931": "Unknown node ID",
"0x932": "Unknown node ID",
"0x933": "Inverse schema changes should never be transmitted",
"0x934": "Expected effect to cover entire mark",
"0x935": "Invalid write version for FieldBatch codec",
"0x936": "should be token",
"0x936": "authHeader should not be null or empty",
"0x937": "inital snapshot should only be defined once",
"0x938": "attachment snapshot should be defined",
"0x939": "trying to set a non attachment snapshot",
@ -1497,7 +1486,6 @@ export const shortCodeMap = {
"0x95d": "Resubmit phase should start with the oldest local commit",
"0x95e": "Local metadata must contain schema and policy.",
"0x95f": "invalid schema class",
"0x960": "Schema class schema must override static constructorCached member",
"0x961": "Schema class not properly configured",
"0x962": "overwriting wrong cache",
"0x963": "Invalid InternalTreeNode",
@ -1547,7 +1535,6 @@ export const shortCodeMap = {
"0x98f": "Node may not be multi-parented",
"0x990": "A field already exists for the given MapTrees",
"0x991": "Node is already parented under a different field",
"0x992": "Expected field to be cached",
"0x993": "'Any' type is not supported",
"0x994": "Unrecognized node kind",
"0x995": "missing visitor cursor while editing",
@ -1573,5 +1560,57 @@ export const shortCodeMap = {
"0x9a9": "expected to find a parent commit",
"0x9aa": "identifier must be type string",
"0x9ab": "childId is undefined in unpackChildNodesUsedRoutes",
"0x9ac": "Missing tenant ID!"
"0x9ac": "Missing tenant ID!",
"0x9ad": "previous ordinal should not be empty",
"0x9ae": "a snapshot for removed roots does not exist",
"0x9af": "A view cannot be rebased while it has a pending transaction",
"0x9b0": "Views cannot be merged into a view while it has a pending transaction",
"0x9b1": "Expected tree node to have kernel",
"0x9b2": "Expected tree node to have kernel",
"0x9b3": "invalid schema",
"0x9b4": "Unexpected flex node implementation",
"0x9b5": "Inheritance should work",
"0x9b6": "No error to clear",
"0x9b7": "anchor set must be empty",
"0x9b8": "Inconsistent data: missing detached node entry",
"0x9b9": "Inconsistent data: missing node entry in latestRelevantRevision",
"0x9ba": "Unable to delete unknown entry",
"0x9bb": "Unable to delete unknown entry",
"0x9bc": "detached node id does not exist in the detached field index",
"0x9bd": "revisions should only be set once using this function after loading data from a summary",
"0x9be": "The storedNodeSchema in stored.nodeSchema should not be undefined",
"0x9bf": "The storedNodeSchema in stored.nodeSchema should not be undefined",
"0x9c0": "The storedNodeSchema in stored.nodeSchema should not be undefined",
"0x9c1": "Unknown field kind",
"0x9c2": "Cross field key registered for empty field",
"0x9c3": "There should be no new changes in this field",
"0x9c4": "Expected an empty field",
"0x9c5": "Keys should not be moved manually during invert",
"0x9c6": "TODO: Modifying a cross-field key from the new changeset is currently unsupported",
"0x9c7": "Cross field key not registered in base or new change",
"0x9c8": "Cross field key not registered in base or new change",
"0x9c9": "Expected node to have field changes",
"0x9ca": "Unknown node ID",
"0x9cb": "Parent field should be defined",
"0x9cc": "id should not include slashes",
"0x9cd": "id should not include slashes",
"0x9ce": "id is undefined in getBlobManagerTreeFromTree",
"0x9cf": "id is undefined in getBlobManagerTreeFromTreeWithBlobContents",
"0x9d0": "id of the fetched snapshot should be defined",
"0x9d1": "expected non-empty batch",
"0x9d2": "unexpected negative clientSequenceNumber (empty batch should yield undefined)",
"0x9d3": "Grouped batch interrupting another batch",
"0x9d4": "Processor batch should be empty on grouped batch",
"0x9d5": "Unexpected batch end marker",
"0x9d6": "Unexpected batch start marker",
"0x9d7": "id is undefined in ChannelStorageService.readBlob()",
"0x9d8": "sessionArray is undefined in IdCompressor.deserialize2_0",
"0x9d9": "value is undefined in readNumber",
"0x9da": "lowerHalf is undefined in readNumericUuid",
"0x9db": "upperHalf is undefined in readNumericUuid",
"0x9dc": "value is undefined in Session.binarySearch",
"0x9dd": "ranges[0] is undefined in SessionSpaceNormalizer.getRangesBetween",
"0x9de": "lastRange is undefined in SessionSpaceNormalizer.getRangesBetween",
"0x9df": "Key should be a string",
"0x9e0": "Value should be a number"
};

Просмотреть файл

@ -245,8 +245,8 @@ export class SampledTelemetryHelper<
loggerData: LoggerData,
): LoggerData {
for (const [key, val] of Object.entries(customData)) {
assert(typeof key === "string", "Key should be a string");
assert(typeof val === "number", "Value should be a number");
assert(typeof key === "string", 0x9df /* Key should be a string */);
assert(typeof val === "number", 0x9e0 /* Value should be a number */);
loggerData.dataSums[key] = (loggerData.dataSums[key] ?? 0) + val;
loggerData.dataMaxes[key] = Math.max(