Skip to content

Commit 51f1edb

Browse files
authored
tag asserts for 2.70 (#25764)
pnpm run policy-check:asserts
1 parent c038fca commit 51f1edb

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed

packages/dds/tree/src/feature-libraries/chunked-forest/codec/compressedEncode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ export const incrementalFieldEncoder: FieldEncoder = {
456456
): void {
457457
assert(
458458
context.incrementalEncoder !== undefined,
459-
"incremental encoder must be defined to use incrementalFieldEncoder",
459+
0xc88 /* incremental encoder must be defined to use incrementalFieldEncoder */,
460460
);
461461

462462
const chunkReferenceIds = context.incrementalEncoder.encodeIncrementalField(

packages/dds/tree/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ export class ForestIncrementalSummaryBuilder implements IncrementalEncoderDecode
529529
chunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,
530530
): TreeChunk {
531531
const ChunkLoadProperties = this.loadedChunksMap.get(`${referenceId}`);
532-
assert(ChunkLoadProperties !== undefined, "Encoded incremental chunk not found");
532+
assert(ChunkLoadProperties !== undefined, 0xc86 /* Encoded incremental chunk not found */);
533533
const chunk = chunkDecoder(ChunkLoadProperties.encodedContents);
534534

535535
// Account for the reference about to be added in `chunkTrackingPropertiesMap`

packages/dds/tree/src/simple-tree/api/incrementalAllowedTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function getShouldIncrementallySummarizeAllowedTypes(
100100
);
101101
assert(
102102
allowedTypes !== undefined,
103-
"Non object nodes with fields should only have one allowedTypes entry",
103+
0xc87 /* Non object nodes with fields should only have one allowedTypes entry */,
104104
);
105105
return isIncrementalSummaryHintInAllowedTypes(allowedTypes);
106106
};

packages/loader/container-loader/src/container.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,7 @@ export class Container
22362236
// Signal-based Audience does not wait for ops. So provide clientId
22372237
// as soon as possible.
22382238
const clientId = this.connectionStateHandler.pendingClientId;
2239-
assert(clientId !== undefined, "catching up without clientId");
2239+
assert(clientId !== undefined, 0xc89 /* catching up without clientId */);
22402240
this.signalAudience.setCurrentClientId(clientId);
22412241
}
22422242

@@ -2566,7 +2566,10 @@ export class Container
25662566
case ConnectionState.CatchingUp: {
25672567
// When catching up, we have a pending clientId, but it
25682568
// is not usable for ops. Send clientId with canSendOps false.
2569-
assert(pendingClientConnectionId !== undefined, "catching up without clientId");
2569+
assert(
2570+
pendingClientConnectionId !== undefined,
2571+
0xc8a /* catching up without clientId */,
2572+
);
25702573
setConnectionStatus({
25712574
connectionState,
25722575
pendingClientConnectionId,
@@ -2580,10 +2583,10 @@ export class Container
25802583
// When connected, we have an active clientId. Pass it along
25812584
// with canSendOps true/false based on readonly.
25822585
const clientConnectionId = this.clientId;
2583-
assert(clientConnectionId !== undefined, "connected without clientId");
2586+
assert(clientConnectionId !== undefined, 0xc8b /* connected without clientId */);
25842587
assert(
25852588
clientConnectionId === pendingClientConnectionId,
2586-
"connected with different clientId than pending",
2589+
0xc8c /* connected with different clientId than pending */,
25872590
);
25882591
setConnectionStatus({
25892592
connectionState,

packages/runtime/container-runtime/src/containerRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,7 @@ export class ContainerRuntime
28392839
assert(
28402840
this.getConnectionState !== undefined &&
28412841
this.getConnectionState() === ConnectionState.CatchingUp,
2842-
"connection state mismatch between getConnectionState and setConnectionStatus notification",
2842+
0xc8d /* connection state mismatch between getConnectionState and setConnectionStatus notification */,
28432843
);
28442844

28452845
// Note: Historically when only `setConnectionState` of `IRuntime`

packages/runtime/test-runtime-utils/src/assertionShortCodesMap.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ export const shortCodeMap = {
458458
"0x2e4": "there should be service config for active connection",
459459
"0x2e8": "There should be a store context for the op",
460460
"0x2e9": "Must call getLocalState() after applying initial states",
461-
"0x2ea": "Configuration state should be enabled",
462461
"0x2eb": "Summary not supported with configuration disabled",
463462
"0x2ec": "Blob must be present in blobsContents",
464463
"0x2ed": "There should be a channel context for the op",
@@ -1805,12 +1804,7 @@ export const shortCodeMap = {
18051804
"0xc23": "Tracked summary properties must be available when tracking a summary",
18061805
"0xc24": "Already tracking a summary",
18071806
"0xc25": "Tracked summary properties must not be available when ready to track",
1808-
"0xc26": "Incremental chunk contents not found",
18091807
"0xc27": "incremental decoder not available for incremental field decoding",
1810-
"0xc28": "Incremental chunk data missing",
1811-
"0xc29": "should return to fields mode when finished encoding",
1812-
"0xc2a": "incremental encoding must be enabled to use IncrementalFieldShape",
1813-
"0xc2b": "incremental encoding must be enabled",
18141808
"0xc2c": "The data store should be locally visible when generating attach summary",
18151809
"0xc2d": "logger would be in sessionIdOrLogger in this codepath",
18161810
"0xc2e": "DecomposedContainerForContainerRuntime is not a ContainerRuntime",
@@ -1897,5 +1891,13 @@ export const shortCodeMap = {
18971891
"0xc82": "Attempting to attach from unexpected state",
18981892
"0xc83": "Pending blob must be in local cache",
18991893
"0xc84": "Pending blob must not be in attached state",
1900-
"0xc85": "bind must be an ISharedObjectHandle"
1894+
"0xc85": "bind must be an ISharedObjectHandle",
1895+
"0xc86": "Encoded incremental chunk not found",
1896+
"0xc87": "Non object nodes with fields should only have one allowedTypes entry",
1897+
"0xc88": "incremental encoder must be defined to use incrementalFieldEncoder",
1898+
"0xc89": "catching up without clientId",
1899+
"0xc8a": "catching up without clientId",
1900+
"0xc8b": "connected without clientId",
1901+
"0xc8c": "connected with different clientId than pending",
1902+
"0xc8d": "connection state mismatch between getConnectionState and setConnectionStatus notification"
19011903
};

0 commit comments

Comments
 (0)