Commit graph

9 commits

Author SHA1 Message Date
Barrett Ruth
a202725cc5
fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305)
## Problem

After the initial submit hardening, two issues remained: source code was
read in Lua and piped as stdin to the scraper (unnecessary roundtrip
since
the file exists on disk), and CF's `page.fill()` timed out on the hidden
`textarea[name="source"]` because CodeMirror owns the editor state.

## Solution

Pass the source file path as a CLI arg instead — AtCoder calls
`page.set_input_files(file_path)` directly, CF reads it with
`Path(file_path).read_text()`. Fix CF source injection via
`page.evaluate()`
into the CodeMirror instance. Extract `BROWSER_SUBMIT_NAV_TIMEOUT` as a
per-platform `defaultdict` (CF defaults to 2× nav timeout). Save the
buffer
with `vim.cmd.update()` before submitting.
2026-03-05 14:34:14 -05:00
18dbcd43d2 fix(cache): contest override 2025-10-04 12:48:57 -04:00
9e84d57b8a feat: context, not config 2025-09-24 18:21:34 -04:00
540364926d feat: improve logging 2025-09-23 16:14:21 -04:00
e171017ab0 fixup 2025-09-23 09:42:45 -04:00
beda8a3a03 fix(logger): remove config 2025-09-22 16:48:46 -04:00
373e7f6e76 fix(test): mock caches and everything else 2025-09-21 12:26:06 -04:00
bc315818e4 fix(ci): format 2025-09-18 20:04:36 -04:00
e9f1b06843 feat: update logging with debug logs 2025-09-12 23:21:32 -05:00