mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* fix(kinesis): reject records over the 1 MiB size limit PutRecord and PutRecords accepted records of any size; real Kinesis rejects a record whose data blob plus partition key exceeds the stream's maximum record size (1 MiB by default). Floci doesn't implement UpdateMaxRecordSize, so every stream sits at the default. Validate in putRecordWithShardId, covering both operations. An oversized record in PutRecords fails the whole request up front, before anything is written: the per-record ErrorCode field is reserved for ProvisionedThroughputExceededException and InternalFailure, so a size violation cannot be reported per record. Closes #1755 * refactor(kinesis): decode batch entries once and resolve stream first Review round: cache successful Data decodes for the write loop (malformed entries keep their per-record failure), resolve the stream before the size check so a missing stream reports ResourceNotFoundException, and add a wire-level PutRecords over-limit test. * test(kinesis): cover PutRecords per-record failure and unknown stream Two paths the size-limit change touched had no coverage: no test produced a non-zero FailedRecordCount for Kinesis, and none covered PutRecords against a missing stream. Malformed per-record Data must stay a per-record InternalFailure rather than a whole-batch failure. Collapsing the decode fallback to entry.data() drops FailedRecordCount to 0 and stores a record with a null blob, since validateRecordSize only counts the partition key; the next GetRecords then fails on the encode. Resolving the stream up front turns PutRecords against a missing stream into ResourceNotFoundException instead of a per-record InternalFailure.