Address autocomplete search sanitisation
Strip canonical-format `(streetNo)` bracket and trailing 4-digit postcode from the autocomplete query before hitting the suggest backend
Overview
When a user types or pastes a fully-canonical address into the autocomplete input - for example LOT 308 (13) PAUL AVENUE KEILOR EAST 3033 - the suggest backend used to receive that literal string and return few or no matches. The bracketed street number and the trailing postcode tightened the token match too far.
Release 3.10 ships a query-side sanitiser that strips both before sending to the backend, so the same input now searches as LOT 308 PAUL AVENUE KEILOR EAST and finds the expected suggestions.
Behaviour
| User input | Sent to suggest backend |
|---|---|
LOT 308 (13) PAUL AVENUE KEILOR EAST 3033 | LOT 308 PAUL AVENUE KEILOR EAST |
123 PAUL AVENUE KEILOR EAST 3033 | 123 PAUL AVENUE KEILOR EAST |
LOT 308 (13) PAUL AVENUE | LOT 308 PAUL AVENUE |
Hopkins Road 3030 | Hopkins Road |
KEILOR EAST 3033 | KEILOR EAST |
3033 (postcode only) | 3033 (untouched - no preceding whitespace) |
LOT 308 PAUL AVENUE (already clean) | LOT 308 PAUL AVENUE (unchanged) |
The raw input value is left untouched in the input element so the canonical-format comparison used to detect "user has typed something different from the last suggestion they selected" still works (Trello 1762 canonicalisation behaviour preserved).
Why both transforms
The (streetNo) bracket only appears in the canonical lot format used internally by the platform; it is not part of any backend-friendly tokenisation, so stripping it expands the match window without losing intent. The trailing 4-digit Australian postcode is similarly redundant when the suburb is already in the query, and including it turned matches that should pass into ones that fail.
Mirrored to ordering portal
Mirrored to both app/assets/controllers/address_autocomplete_controller.js and ordering/assets/controllers/address_autocomplete_controller.js. The recurring lesson from Trello 1762 - address fixes that land on app/ often silently miss ordering/ - was honoured: the change went out as one PR touching both controllers.
Verification
Regex unit-tested locally before ship:
"LOT 308 (13) PAUL AVENUE KEILOR EAST 3033" -> "LOT 308 PAUL AVENUE KEILOR EAST"
" LOT 5 (12) GUMNUT ST CLAYTON 3168 " -> "LOT 5 GUMNUT ST CLAYTON"Browser-verified post-deploy on https://platform.ftsonline.com.au and https://ordering.ftsonline.com.au.
Related
- Trello 1762 - the canonicalisation work that produced the bracket format in the first place.
- Git tag v3.13.3.