fix(terminal): preserve UTF-8 replay chunks (#1181)
* fix(terminal): preserve UTF-8 replay chunks * fix(terminal): avoid replay trim prepends --------- Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
committed by
GitHub
co-authored by
Isaac Sanchez
parent
2a9c7e6bca
commit
323347f50e
@@ -56,6 +56,15 @@ describe('terminal output replay buffer', () => {
|
||||
expect(bufferState.totalBytes).toBe(4);
|
||||
});
|
||||
|
||||
it('does not split multibyte characters when trimming oversized chunks', () => {
|
||||
const bufferState = createTerminalOutputReplayBuffer();
|
||||
const chunk = appendTerminalOutputReplayChunk(bufferState, '🙂x', 2);
|
||||
|
||||
expect(chunk?.data).toBe('x');
|
||||
expect(chunk?.bytes).toBe(1);
|
||||
expect(bufferState.totalBytes).toBe(1);
|
||||
});
|
||||
|
||||
it('uses the default max bytes when not provided', () => {
|
||||
const bufferState = createTerminalOutputReplayBuffer();
|
||||
const chunk = appendTerminalOutputReplayChunk(bufferState, 'ok');
|
||||
|
||||
Reference in New Issue
Block a user