Skip to content

Commit

Permalink
limit token to 36 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
leviramsey committed Nov 9, 2024
1 parent 8308862 commit 18aec0a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ import software.amazon.awssdk.services.dynamodb.model.Update
}.asJava

val firstEvent = events.head;
val token = s"${firstEvent.writerUuid}-${firstEvent.seqNr.toString}"
val token = {
val base = s"${firstEvent.writerUuid}-${firstEvent.seqNr.toString}"
val len = base.length
if (len > 36) {
base.substring(len - 36, len)
} else base
}

val req = TransactWriteItemsRequest
.builder()
Expand Down

0 comments on commit 18aec0a

Please sign in to comment.