-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
I am getting a max length error when writing the checkpoints to the meta instance, specifically this line in checkpoint.ts. The error is a validation error that the id exceeds the maximum length. Stepping through the code, the id is set in a call to getComposedPrimaryKeyOfDocumentData a few lines above which is setting the id to up|1 where up is the direction.
But looking at the definition of the meta instance, it is defined like so:
id: {
type: 'string',
minLength: 1,
// add +1 for the '|' and +1 for the 'isCheckpoint' flag
maxLength: parentPrimaryKeyLength + 2
},
But, in my own collection, I have a maximum key length of 1 (keys are only a single character),
so this is calculated to 3. But up|1 has length 4.
I see that down|1 is also a key, so the max length for the meta instance should probably be max(4, parentPrimaryKeyLength) + 2.