From e28ccb627a06f1613051f62c19a57e175892084b Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 21:39:53 -0800 Subject: [PATCH] Fix pressSequentially -> type() and extend submit polling to ~15s Playwright on AWS doesn't have pressSequentially, use type() instead. Extend submit polling from 4 to 6 iterations (~15s total) to handle slower reCAPTCHA verification. Co-Authored-By: Claude Opus 4.6 --- lib/apply/generic.mjs | 4 ++-- lib/apply/greenhouse.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/apply/generic.mjs b/lib/apply/generic.mjs index 995b253..56e5c54 100644 --- a/lib/apply/generic.mjs +++ b/lib/apply/generic.mjs @@ -154,8 +154,8 @@ async function fillAndSubmit(page, job, formFiller, meta, opts) { // (invisible reCAPTCHA + server round-trip can take several seconds) const verifySelector = opts.verifySelector || 'form button[type="submit"]:not([disabled])'; let postSubmit = { hasSuccess: false, hasForm: true, validationErrors: [] }; - for (let wait = 0; wait < 4; wait++) { - await page.waitForTimeout(wait === 0 ? SUBMIT_WAIT : 2000); + for (let wait = 0; wait < 6; wait++) { + await page.waitForTimeout(wait === 0 ? SUBMIT_WAIT : 2500); postSubmit = await page.evaluate((vs) => { const text = (document.body.innerText || '').toLowerCase(); const errorEls = document.querySelectorAll('[class*="error"], [class*="invalid"], [role="alert"]'); diff --git a/lib/apply/greenhouse.mjs b/lib/apply/greenhouse.mjs index 813bc7d..7b273d7 100644 --- a/lib/apply/greenhouse.mjs +++ b/lib/apply/greenhouse.mjs @@ -44,7 +44,7 @@ export async function apply(page, job, formFiller) { await el.click(); await el.evaluate(e => { e.value = ''; }); - await el.pressSequentially(value, { delay: 30 }); + await el.type(value, { delay: 30 }); await page.waitForTimeout(1000); const option = await page.$(`[id*="react-select-${id}-option"]`); if (option) {