fix(codeforces): persist cookies after submit regardless of name (#312)

## Problem

The submit path in `codeforces.py` guarded `cookie_cache.write_text` on
the presence of a `JSESSIONID` cookie. Codeforces does not use
`JSESSIONID`, so the cookie file was never written after submit,
breaking the fast-path on subsequent submits.

## Solution

Replace the name-specific guard with a non-empty check (`if
browser_cookies:`), matching the unconditional save already used in the
login path.

Closes #301.
This commit is contained in:
Barrett Ruth 2026-03-05 15:31:29 -05:00 committed by GitHub
parent 2c119774df
commit 924601ce99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -550,7 +550,7 @@ def _submit_headless(
try:
browser_cookies = session.context.cookies()
if any(c["name"] == "JSESSIONID" for c in browser_cookies):
if browser_cookies:
cookie_cache.write_text(json.dumps(browser_cookies))
except Exception:
pass