FA-22456 / Autocomplete interactions / Open access
Autocomplete loading and empty states: old-query failure overwrites current autocomplete status · case 01
The error completion transition produces an incorrect observable state.
ROOT CAUSE
At loading-presentation/error, the implementation evaluates `d['error']` instead of preserving the specified completion transition.
THE FAILURE
At loading-presentation/error, the implementation evaluates `d['error']` instead of preserving the specified completion transition.
Unsuccessful approach: The attempted repair uses `d['error'] if d['error_epoch']<=d['epoch'] else None`, which still violates a normal or boundary completion fixture.
Case contract
A loading snapshot distinguishes initial loading, background refreshing, settled-empty, error and cancellation. Only settled successful empty responses show no-results. Existing rows may remain visible during refresh but are bound to the draft they represent; stale errors never overwrite a newer query status.
Why this case matters
Autocomplete couples draft text, suggestion identity and asynchronous presentation; this bounded lifecycle model isolates one observable interaction defect.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(event, d):
if event == 'initial': return d['pending'] and not d['rows']
if event == 'refreshing': return d['pending'] and bool(d['rows'])
if event == 'empty': return d['settled'] and not d['pending'] and not d['rows'] and d['error'] is None
if event == 'error': return d['error']
if event == 'selectable': return d['rows'] if d['rows_query']==d['query'] else []
if event == 'cancel': return None if d['cancelled'] else d['error']
if event == 'busy': return d['pending']
if event == 'preserve': return d['rows']
if event == 'status-priority': return 'error' if d['error'] else 'loading' if d['pending'] else 'empty' if not d['rows'] else 'results'
if event == 'retry-label': return {'query':d['query'],'error':d['error']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pending':True,'rows':['a'],'query':'pe','rows_query':'p','error':'timeout','error_epoch':N-1,'epoch':N,'settled':False,'cancelled':True}
boundary = {'pending':False,'rows':[],'query':'','rows_query':'','error':None,'error_epoch':N,'epoch':N,'settled':True,'cancelled':False}
check('normal initial', solve('initial', normal), False)
check('boundary initial', solve('initial', boundary), False)
check('normal refreshing', solve('refreshing', normal), True)
check('boundary refreshing', solve('refreshing', boundary), False)
check('normal empty', solve('empty', normal), False)
check('boundary empty', solve('empty', boundary), True)
check('normal error', solve('error', normal), None)
check('boundary error', solve('error', boundary), None)
check('normal selectable', solve('selectable', normal), [])
check('boundary selectable', solve('selectable', boundary), [])
check('normal cancel', solve('cancel', normal), None)
check('boundary cancel', solve('cancel', boundary), None)
check('normal busy', solve('busy', normal), True)
check('boundary busy', solve('busy', boundary), False)
check('normal preserve', solve('preserve', normal), ['a'])
check('boundary preserve', solve('preserve', boundary), [])
check('normal status-priority', solve('status-priority', normal), 'error')
check('boundary status-priority', solve('status-priority', boundary), 'empty')
check('normal retry-label', solve('retry-label', normal), {'query':'pe','error':'timeout'})
check('boundary retry-label', solve('retry-label', boundary), {'query':'','error':None})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('retry-label', variant), {'query':'q'*N,'error':'timeout'})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal initial | False | False | Passed |
| boundary initial | False | False | Passed |
| normal refreshing | True | True | Passed |
| boundary refreshing | False | False | Passed |
| normal empty | False | False | Passed |
| boundary empty | True | True | Passed |
| normal error | timeout | None | Failed |
| boundary error | None | None | Passed |
| normal selectable | [] | [] | Passed |
| boundary selectable | [] | [] | Passed |
| normal cancel | None | None | Passed |
| boundary cancel | None | None | Passed |
| normal busy | True | True | Passed |
| boundary busy | False | False | Passed |
| normal preserve | ['a'] | ['a'] | Passed |
| boundary preserve | [] | [] | Passed |
| normal status-priority | error | error | Passed |
| boundary status-priority | empty | empty | Passed |
| normal retry-label | {'error': 'timeout', 'query': 'pe'} | {'error': 'timeout', 'query': 'pe'} | Passed |
| boundary retry-label | {'error': None, 'query': ''} | {'error': None, 'query': ''} | Passed |
| variant query or selection payload | {'error': 'timeout', 'query': 'q'} | {'error': 'timeout', 'query': 'q'} | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 8bda285a4ba0dda349ed597d8d0ae72b3ac1db2858e0623fa22284ef80f70421
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(event, d):
if event == 'initial': return d['pending'] and not d['rows']
if event == 'refreshing': return d['pending'] and bool(d['rows'])
if event == 'empty': return d['settled'] and not d['pending'] and not d['rows'] and d['error'] is None
if event == 'error': return d['error'] if d['error_epoch']<=d['epoch'] else None
if event == 'selectable': return d['rows'] if d['rows_query']==d['query'] else []
if event == 'cancel': return None if d['cancelled'] else d['error']
if event == 'busy': return d['pending']
if event == 'preserve': return d['rows']
if event == 'status-priority': return 'error' if d['error'] else 'loading' if d['pending'] else 'empty' if not d['rows'] else 'results'
if event == 'retry-label': return {'query':d['query'],'error':d['error']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pending':True,'rows':['a'],'query':'pe','rows_query':'p','error':'timeout','error_epoch':N-1,'epoch':N,'settled':False,'cancelled':True}
boundary = {'pending':False,'rows':[],'query':'','rows_query':'','error':None,'error_epoch':N,'epoch':N,'settled':True,'cancelled':False}
check('normal initial', solve('initial', normal), False)
check('boundary initial', solve('initial', boundary), False)
check('normal refreshing', solve('refreshing', normal), True)
check('boundary refreshing', solve('refreshing', boundary), False)
check('normal empty', solve('empty', normal), False)
check('boundary empty', solve('empty', boundary), True)
check('normal error', solve('error', normal), None)
check('boundary error', solve('error', boundary), None)
check('normal selectable', solve('selectable', normal), [])
check('boundary selectable', solve('selectable', boundary), [])
check('normal cancel', solve('cancel', normal), None)
check('boundary cancel', solve('cancel', boundary), None)
check('normal busy', solve('busy', normal), True)
check('boundary busy', solve('busy', boundary), False)
check('normal preserve', solve('preserve', normal), ['a'])
check('boundary preserve', solve('preserve', boundary), [])
check('normal status-priority', solve('status-priority', normal), 'error')
check('boundary status-priority', solve('status-priority', boundary), 'empty')
check('normal retry-label', solve('retry-label', normal), {'query':'pe','error':'timeout'})
check('boundary retry-label', solve('retry-label', boundary), {'query':'','error':None})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('retry-label', variant), {'query':'q'*N,'error':'timeout'})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal initial | False | False | Passed |
| boundary initial | False | False | Passed |
| normal refreshing | True | True | Passed |
| boundary refreshing | False | False | Passed |
| normal empty | False | False | Passed |
| boundary empty | True | True | Passed |
| normal error | timeout | None | Failed |
| boundary error | None | None | Passed |
| normal selectable | [] | [] | Passed |
| boundary selectable | [] | [] | Passed |
| normal cancel | None | None | Passed |
| boundary cancel | None | None | Passed |
| normal busy | True | True | Passed |
| boundary busy | False | False | Passed |
| normal preserve | ['a'] | ['a'] | Passed |
| boundary preserve | [] | [] | Passed |
| normal status-priority | error | error | Passed |
| boundary status-priority | empty | empty | Passed |
| normal retry-label | {'error': 'timeout', 'query': 'pe'} | {'error': 'timeout', 'query': 'pe'} | Passed |
| boundary retry-label | {'error': None, 'query': ''} | {'error': None, 'query': ''} | Passed |
| variant query or selection payload | {'error': 'timeout', 'query': 'q'} | {'error': 'timeout', 'query': 'q'} | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 3417e63effec9b6f582f32880e4cf16339f9646d129e175da33ccac6361f03f2
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 22 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
Stipulated deterministic widget transition model; inputs are validated snapshots. It does not model browser event dispatch, network transport, or linguistic standards. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:40:38.896271+00:00.
Case digest / 3b1d89a172eaf8799e5861c94e10cf947a420e482e5f476b95f43d5af64be935