Skip to content

Conversation

@Mond1c
Copy link
Contributor

@Mond1c Mond1c commented Nov 3, 2025

support new format

const data: number[] = await response.json();
setKeylog(data);
const events = await fetchNDJSON();
const startTime = new Date(contestInfo?.status.type === ContestStatus.Type.running ? contestInfo.status.startedAtUnixMs : 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Playwright tests screens

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Playwright tests screens

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Playwright tests screens

Comment on lines 27 to 32
case ContestStatus.Type.before:
return contestInfo.status.scheduledStartAtUnixMs ?? 0;
case ContestStatus.Type.running:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to return undefined, not 0

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Playwright tests screens

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Playwright tests screens

@Mond1c Mond1c force-pushed the update-keylog-parse branch from fa4ec22 to 690e872 Compare November 22, 2025 15:08
@github-actions
Copy link

Playwright tests screens

@github-actions
Copy link

Playwright tests screens

@github-actions
Copy link

Playwright tests screens

@github-actions
Copy link

Playwright tests screens

);
}

interface KeyboardEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.trim()
.split("\n")
.filter((line) => line.trim())
.map((line) => JSON.parse(line) as KeyboardEvent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a single last line is not fully read/written we won't be showing all the keyboard events. Maybe it's a good idea to add the try/catch somewhere else or extract this whole procedure to a function that would try to read all the events

.trim()
.split("\n")
.filter((line) => line.trim())
.map((line) => JSON.parse(line) as KeyboardEvent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds computationally heavy considering that a keylog file might be more than a megabyte. Moving it to a seperate worker that would fetch and cache the keylog data is probably a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants