Skip to content

fix(extension): fill the whole mailing address when its second line says "Continued" and its states load late - #369

Merged
kitlangton merged 4 commits into
devfrom
gauntlet-identity-address
Dec 2, 2026
Merged

kitlangton merged 4 commits into
devfrom
gauntlet-identity-address

Conversation

@kitlangton

@kitlangton kitlangton commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Picking an address on a "mail me a check" form now fills the whole address, not just the name and a street box crammed with everything.
An address saved as one line ("123 Main St, San Francisco, CA, 94117, United States") went whole into the first street box, past its 40-character limit, and the city, country, state and ZIP stayed empty. Login filling isn't touched.

🔍 Origin: seen in real use, on a payout form whose mailing address appears after choosing "Paper check".

❌ Before

  1. The form asks for First Name, Last Name, Current Address, Current Address Continued, City, Country, State, Zip Code.
  2. ❌ "Current Address Continued" has no "2" and no autocomplete hint, so it was read as another first street line.
  3. ❌ A first street line seen twice starts a new address, so the form was cut in two: names + street, and everything else.
  4. ❌ The half that was picked had no city or ZIP box, so the one-line address wasn't split: all of it went into the street box ("too many characters") and five fields stayed empty.
  5. ❌ Even split correctly, the State list held only Select (with the value 0) until Country was chosen, so nothing waited for it, and its options ("NY - New York", value 32) matched neither a code nor a name.

✅ After

  1. "… Continued", "Street address 2", "Address line two", "Additional address", "c/o" and the like are a second street line.
  2. Two street boxes in a row with no box of any kind between them ("Street Address", then "Street Address (optional)") are one address's lines. A shipping address followed by a billing address is still two addresses, and "Home address" then "Work address" are still two, whether the label or a fieldset's legend names them.
  3. A State list with nothing for the saved state waits (up to 2.5 s) for the Country that was just chosen to load it.
  4. "NY - New York" and "New York (NY)" are found by code and name, whatever the option's value is. "West Virginia" is never taken for Virginia, and a prompt with no value ("Select (e.g. New York)") is never the match.
- "Address Continued" -> first line again -> new section -> no city/ZIP beside the street -> whole line into one box
+ "Address Continued" -> second line -> one section -> street | unit | city | country | state | ZIP
- state <select> with only <option value="0">Select</option> -> "no match", skipped
+ state <select> with no match yet, country just chosen -> wait for its options -> choose "NY - New York"

📊 Proof

Case Before After
Mailing form, address saved on one line ❌ 3 of 8 fields, street over 40 characters ✅ 8 of 8, street 11 characters
Mailing form, address saved in parts ❌ 3 of 8 fields ✅ 8 of 8
"Street Address" + "Street Address (optional)" ❌ no menu on the street box ✅ both lines, city, state, ZIP
Shipping then billing in one form ✅ two addresses ✅ two addresses
"Home address" then "Work address" ✅ two addresses ✅ two addresses

12 new unit tests: 8 fail without the first commit and 2 are guards that pass either way (blocks that must stay separate); the two review commits add 3 tests and extend a fourth, each red without its fix. "Years at address" and "How long…" boxes are no longer read as a street line. The two new browser pages weren't run against the old code.

👀 Read: consecutiveAddressLines in extension/src/content/forms.ts: it decides when a second "Address" box belongs to the address before it, and its list of words that mean "a different address" (home, work, billing…) is a judgement call. One cost to know: a State list that never gets the saved state now holds the fill for the full 2.5 s when the Country was just chosen, where it used to give up at once. The rest is routine.

🔍 The red cargo-deny check isn't this change: a dependency withdrew the release Cargo.lock names, on every branch; #370 fixes it · the whole browser suite passed in CI, both new pages included · all names and addresses in tests are made up

Checks run
  • bun run typecheck: clean
  • bun test: 1,060 pass, 0 fail, on top of current dev (which adds 12 tests of its own; 13 here are this change's)
  • bun corpus/score.ts --gate: pass, 163/163 pages exact, address 30/30, decoy false-trigger 0.0%
  • bun run build: built 5 entries
  • GAUNTLET_PAGES=mailing-address-continued,address-optional-line,below-fold-checkout bun e2e/run.ts --only gauntletTraps: all passed, 30 checks (mailing-address-continued 14, address-optional-line 7, below-fold-checkout 8, plus the extension id). That local run was before the last edit (the one-line test identity is listed only for the unit that picks it); CI ran the final commit.
  • CI on the final commit: all four browser e2e shards and the security e2e pass, 57 Gauntlet pages pass and 0 fail, with mailing-address-continued and address-optional-line among them. Rust, wasm, site and unused-dependency jobs pass. cargo-deny fails on a yanked pin-project-lite (see chore: move pin-project-lite off its yanked release so cargo-deny passes #370).
  • bash scripts/file-size.sh: 0 errors

…"Continued" and its states load late

A payout form's mailing address (first and last name, "Current Address",
"Current Address Continued", city, country, state, ZIP) filled only the
names and the first street box. An identity that keeps its whole address
on one line put all of it in that box, past the box's 40 characters, and
left the city, country, state and ZIP empty.

"Current Address Continued" has no number and no autocomplete, so it read
as a second first line, and a first line seen twice starts a new section:
the address was cut off from its own city, state and postal code.

- A second street line is known by more of its wordings: "Address
  continued", "Street address 2", "Address line two", "Second address
  line", "Line 2", "Additional address", "Secondary address", "c/o".
- Street boxes one after the other are one address's lines: a box guessed
  from text as a first line, right after a first or second line with no
  other detected field between them, in the same form and block, is the
  next line. Never one the site marked by autocomplete, and never one that
  names another address ("Home address", then "Work address"). Two address
  blocks with a city or postal code between them are still two sections.
- A state select beside a country that has no option for the region yet
  (a placeholder with a value of its own, `<option value="0">Select`, or
  another country's regions) waits for the country's change to load it,
  as a disabled or empty one already did. Only when this fill chose the
  country.
- A region is found in a select whose values are the site's own numbers
  and whose text carries the code beside the name ("NY - New York",
  "New York (NY)"), or holds the name as whole words; two options that
  could be it give none.

Two Gauntlet traps cover it in a real browser: a mailing address revealed
by a radio button (filled from an identity with its address in parts and
from one with it on one line), and two street boxes with one label ahead
of a billing address in the same form. The fake host lists the one-line
identity only when asked (DEADBOLT_FAKE_ONE_LINE).
…eldsets' street boxes apart, and a late-loaded list chosen

Three corrections to the mailing-address change, from review.

- A region found by its name as whole words no longer takes an option
  that holds a longer region's name around it: "WV - West Virginia" isn't
  Virginia, alone or beside "State of Virginia". An option with no value
  is a prompt ("Select (e.g. New York)") and is never the match.
- A street box is the next line of the one before only in the same
  fieldset and the same cluster of the page, so "Address" under a "Home
  address" legend and "Address" under a "Work address" legend stay two
  addresses, as do two form-less sections. "Different" and "primary" join
  the words that name another address. The whole-word helper takes its
  flags, which drops the regex built only to be rebuilt.
- A select waiting for its options is read once more after the wait, so
  one that loaded during the last sleep, or while an earlier select used
  the wait up, is still chosen from.
… or not

Two more corrections from review.

- Street boxes are joined into one address's lines by looking at every
  box of the form, not only the ones given a role: a box that's no field
  of ours ("Monthly rent") between two "Address" boxes used to vanish
  before the look, and the second address became the first one's second
  line.
- "Years at address", "Months at address", "Time at address" and "How
  long…" are no street line. They read as one for saying "address", and
  between two addresses that made a second and a third line of what are
  three different things.

The test for a list that loads while an earlier one waits now puts a
salutation ahead of the country: a country is moved ahead of its state,
so the state the test used was second in line, not first.
A box whose label marks it as no card or address field ("Years at
address", "Gift card number") was still given a role when its name or id
happened to hold a clue (name="address_years"): the label was skipped and
the name read on its own. The label's word now ends the reading. Login
words and an empty text still only pass to the next text.
@kitlangton
kitlangton force-pushed the gauntlet-identity-address branch from 875cded to 78625a5 Compare December 2, 2026 21:51
@kitlangton
kitlangton merged commit 9c6d8cb into dev Dec 2, 2026
13 checks passed
@kitlangton
kitlangton deleted the gauntlet-identity-address branch December 2, 2026 22:12
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.

1 participant