FAILURE MAP
← Case archive

FA-34386 / Notification interfaces / Open access

Notification attachment preview: download-original from decode-error · case 01

The download-original event leaves a notification in open instead of download-pending.

Verified by executionVariant 1 · 36 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Requesting the original opens the failed preview instead.

THE FAILURE

Requesting the original opens the failed preview instead.

Unsuccessful approach: Repeating preview fetch ignores the distinct download action.

Case contract

Notification attachment preview is a bounded visual-notification workflow with mutable policy state {'attachment': 'photo', 'bytes': 0, 'decoded': False, 'download': []}. Its default transition relation is {('thumbnail', 'preview-click'): 'fetching', ('fetching', 'content-ready'): 'decoding', ('decoding', 'decode-success'): 'open', ('decoding', 'decode-failure'): 'decode-error', ('fetching', 'fetch-failure'): 'fetch-error', ('fetch-error', 'retry-fetch'): 'fetching', ('open', 'close-preview'): 'thumbnail', ('fetching', 'close-preview'): 'canceled', ('canceled', 'late-content-ready'): 'thumbnail', ('decode-error', 'download-original'): 'download-pending'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

Why this case matters

Visual notification lifecycle ordering can leave an inbox or toast showing the wrong actionable state even when transport succeeds.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('thumbnail', 'preview-click'): 'fetching', ('fetching', 'content-ready'): 'decoding', ('decoding', 'decode-success'): 'open', ('decoding', 'decode-failure'): 'decode-error', ('fetching', 'fetch-failure'): 'fetch-error', ('fetch-error', 'retry-fetch'): 'fetching', ('open', 'close-preview'): 'thumbnail', ('fetching', 'close-preview'): 'canceled', ('canceled', 'late-content-ready'): 'thumbnail', ('decode-error', 'download-original'): 'open'}
    data = json.loads(json.dumps({'attachment': 'photo', 'bytes': 0, 'decoded': False, 'download': []})) if payload is None else {**json.loads(json.dumps({'attachment': 'photo', 'bytes': 0, 'decoded': False, 'download': []})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('content-ready','decode-success','decode-failure') and arg.get('attachment',data['attachment']) != data['attachment']: event = 'unknown-event'
            if event == 'content-ready': data['bytes'] = arg.get('bytes',12)
            if event == 'decode-success' and data['bytes'] == 0 and arg.get('require_bytes',False): event = 'decode-failure'
            state = table.get((state, event), state)
            if state == 'open': data['decoded'] = True
            if state in ('thumbnail','canceled'): data['decoded'] = False
            if state == 'download-pending': data['download'].append(data['attachment'])
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('thumbnail / preview-click', solve('thumbnail', [('preview-click', N)], N), 'fetching')
check('fetching / content-ready', solve('fetching', [('content-ready', N)], N), 'decoding')
check('decoding / decode-success', solve('decoding', [('decode-success', N)], N), 'open')
check('decoding / decode-failure', solve('decoding', [('decode-failure', N)], N), 'decode-error')
check('fetching / fetch-failure', solve('fetching', [('fetch-failure', N)], N), 'fetch-error')
check('fetch-error / retry-fetch', solve('fetch-error', [('retry-fetch', N)], N), 'fetching')
check('open / close-preview', solve('open', [('close-preview', N)], N), 'thumbnail')
check('fetching / close-preview', solve('fetching', [('close-preview', N)], N), 'canceled')
check('canceled / late-content-ready', solve('canceled', [('late-content-ready', N)], N), 'thumbnail')
check('decode-error / download-original', solve('decode-error', [('download-original', N)], N), 'download-pending')
check('older notification incarnation', solve('thumbnail', [('preview-click', N - 1)], N), 'thumbnail')
check('future notification incarnation', solve('thumbnail', [('preview-click', N + 1)], N), 'thumbnail')
check('unknown event is inert', solve('thumbnail', [('unknown-event', N)], N), 'thumbnail')
check('empty delivery batch', solve('thumbnail', [], N), 'thumbnail')
check('N stale deliveries before current delivery', solve('thumbnail', [('preview-click', N - 1)] * N + [('preview-click', N)], N), 'fetching')
check('trace preview-click then content-ready', solve('thumbnail', [('preview-click', N), ('content-ready', N)], N), 'decoding')
check('trace preview-click then fetch-failure', solve('thumbnail', [('preview-click', N), ('fetch-failure', N)], N), 'fetch-error')
check('trace preview-click then close-preview', solve('thumbnail', [('preview-click', N), ('close-preview', N)], N), 'canceled')
check('trace content-ready then decode-success', solve('fetching', [('content-ready', N), ('decode-success', N)], N), 'open')
check('trace content-ready then decode-failure', solve('fetching', [('content-ready', N), ('decode-failure', N)], N), 'decode-error')
check('trace decode-success then close-preview', solve('decoding', [('decode-success', N), ('close-preview', N)], N), 'thumbnail')
check('trace decode-failure then download-original', solve('decoding', [('decode-failure', N), ('download-original', N)], N), 'download-pending')
check('trace fetch-failure then retry-fetch', solve('fetching', [('fetch-failure', N), ('retry-fetch', N)], N), 'fetching')
check('trace retry-fetch then content-ready', solve('fetch-error', [('retry-fetch', N), ('content-ready', N)], N), 'decoding')
check('trace retry-fetch then fetch-failure', solve('fetch-error', [('retry-fetch', N), ('fetch-failure', N)], N), 'fetch-error')
check('trace retry-fetch then close-preview', solve('fetch-error', [('retry-fetch', N), ('close-preview', N)], N), 'canceled')
check('trace close-preview then preview-click', solve('open', [('close-preview', N), ('preview-click', N)], N), 'fetching')
check('trace close-preview then late-content-ready', solve('fetching', [('close-preview', N), ('late-content-ready', N)], N), 'thumbnail')
check('trace late-content-ready then preview-click', solve('canceled', [('late-content-ready', N), ('preview-click', N)], N), 'fetching')
check('domain state regression 1: bytes', solve('fetching', [('content-ready', N, {'attachment': 'old', 'bytes': 7})], N, {}, 'bytes'), {'phase': 'fetching', 'value': 0})
check('domain state regression 2: bytes', solve('fetching', [('content-ready', N, {'bytes': 7})], N, {}, 'bytes'), {'phase': 'decoding', 'value': 7})
check('domain state regression 3: decoded', solve('decoding', [('decode-success', N, {'require_bytes': True})], N, {}, 'decoded'), {'phase': 'decode-error', 'value': False})
check('domain state regression 4: decoded', solve('decoding', [('decode-success', N, {'require_bytes': True})], N, {'bytes': 7}, 'decoded'), {'phase': 'open', 'value': True})
check('domain state regression 5: download', solve('decode-error', [('download-original', N, {})], N, {}, 'download'), {'phase': 'download-pending', 'value': ['photo']})
check('domain state regression 6: decoded', solve('open', [('close-preview', N, {})], N, {'decoded': True}, 'decoded'), {'phase': 'thumbnail', 'value': False})
check('domain state regression 7: decoded', solve('thumbnail', [('preview-click', N, {}), ('content-ready', N, {'bytes': 8}), ('decode-success', N, {'require_bytes': True}), ('close-preview', N, {})], N, {}, 'decoded'), {'phase': 'thumbnail', 'value': False})
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 fixtureActualExpectedOutcome
thumbnail / preview-clickfetchingfetchingPassed
fetching / content-readydecodingdecodingPassed
decoding / decode-successopenopenPassed
decoding / decode-failuredecode-errordecode-errorPassed
fetching / fetch-failurefetch-errorfetch-errorPassed
fetch-error / retry-fetchfetchingfetchingPassed
open / close-previewthumbnailthumbnailPassed
fetching / close-previewcanceledcanceledPassed
canceled / late-content-readythumbnailthumbnailPassed
decode-error / download-originalopendownload-pendingFailed
older notification incarnationthumbnailthumbnailPassed
future notification incarnationthumbnailthumbnailPassed
unknown event is inertthumbnailthumbnailPassed
empty delivery batchthumbnailthumbnailPassed
N stale deliveries before current deliveryfetchingfetchingPassed
trace preview-click then content-readydecodingdecodingPassed
trace preview-click then fetch-failurefetch-errorfetch-errorPassed
trace preview-click then close-previewcanceledcanceledPassed
trace content-ready then decode-successopenopenPassed
trace content-ready then decode-failuredecode-errordecode-errorPassed
trace decode-success then close-previewthumbnailthumbnailPassed
trace decode-failure then download-originalopendownload-pendingFailed
trace fetch-failure then retry-fetchfetchingfetchingPassed
trace retry-fetch then content-readydecodingdecodingPassed
trace retry-fetch then fetch-failurefetch-errorfetch-errorPassed
trace retry-fetch then close-previewcanceledcanceledPassed
trace close-preview then preview-clickfetchingfetchingPassed
trace close-preview then late-content-readythumbnailthumbnailPassed
trace late-content-ready then preview-clickfetchingfetchingPassed
domain state regression 1: bytes{'phase': 'fetching', 'value': 0}{'phase': 'fetching', 'value': 0}Passed
domain state regression 2: bytes{'phase': 'decoding', 'value': 7}{'phase': 'decoding', 'value': 7}Passed
domain state regression 3: decoded{'phase': 'decode-error', 'value': False}{'phase': 'decode-error', 'value': False}Passed
domain state regression 4: decoded{'phase': 'open', 'value': True}{'phase': 'open', 'value': True}Passed
domain state regression 5: download{'phase': 'open', 'value': []}{'phase': 'download-pending', 'value': ['photo']}Failed
domain state regression 6: decoded{'phase': 'thumbnail', 'value': False}{'phase': 'thumbnail', 'value': False}Passed
domain state regression 7: decoded{'phase': 'thumbnail', 'value': False}{'phase': 'thumbnail', 'value': False}Passed

SHA-256 / 4bd5c094ebb1455798fd8f7cefc366913e73b5fa99aa1509e1931e12036e868e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('thumbnail', 'preview-click'): 'fetching', ('fetching', 'content-ready'): 'decoding', ('decoding', 'decode-success'): 'open', ('decoding', 'decode-failure'): 'decode-error', ('fetching', 'fetch-failure'): 'fetch-error', ('fetch-error', 'retry-fetch'): 'fetching', ('open', 'close-preview'): 'thumbnail', ('fetching', 'close-preview'): 'canceled', ('canceled', 'late-content-ready'): 'thumbnail', ('decode-error', 'download-original'): 'fetching'}
    data = json.loads(json.dumps({'attachment': 'photo', 'bytes': 0, 'decoded': False, 'download': []})) if payload is None else {**json.loads(json.dumps({'attachment': 'photo', 'bytes': 0, 'decoded': False, 'download': []})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('content-ready','decode-success','decode-failure') and arg.get('attachment',data['attachment']) != data['attachment']: event = 'unknown-event'
            if event == 'content-ready': data['bytes'] = arg.get('bytes',12)
            if event == 'decode-success' and data['bytes'] == 0 and arg.get('require_bytes',False): event = 'decode-failure'
            state = table.get((state, event), state)
            if state == 'open': data['decoded'] = True
            if state in ('thumbnail','canceled'): data['decoded'] = False
            if state == 'download-pending': data['download'].append(data['attachment'])
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('thumbnail / preview-click', solve('thumbnail', [('preview-click', N)], N), 'fetching')
check('fetching / content-ready', solve('fetching', [('content-ready', N)], N), 'decoding')
check('decoding / decode-success', solve('decoding', [('decode-success', N)], N), 'open')
check('decoding / decode-failure', solve('decoding', [('decode-failure', N)], N), 'decode-error')
check('fetching / fetch-failure', solve('fetching', [('fetch-failure', N)], N), 'fetch-error')
check('fetch-error / retry-fetch', solve('fetch-error', [('retry-fetch', N)], N), 'fetching')
check('open / close-preview', solve('open', [('close-preview', N)], N), 'thumbnail')
check('fetching / close-preview', solve('fetching', [('close-preview', N)], N), 'canceled')
check('canceled / late-content-ready', solve('canceled', [('late-content-ready', N)], N), 'thumbnail')
check('decode-error / download-original', solve('decode-error', [('download-original', N)], N), 'download-pending')
check('older notification incarnation', solve('thumbnail', [('preview-click', N - 1)], N), 'thumbnail')
check('future notification incarnation', solve('thumbnail', [('preview-click', N + 1)], N), 'thumbnail')
check('unknown event is inert', solve('thumbnail', [('unknown-event', N)], N), 'thumbnail')
check('empty delivery batch', solve('thumbnail', [], N), 'thumbnail')
check('N stale deliveries before current delivery', solve('thumbnail', [('preview-click', N - 1)] * N + [('preview-click', N)], N), 'fetching')
check('trace preview-click then content-ready', solve('thumbnail', [('preview-click', N), ('content-ready', N)], N), 'decoding')
check('trace preview-click then fetch-failure', solve('thumbnail', [('preview-click', N), ('fetch-failure', N)], N), 'fetch-error')
check('trace preview-click then close-preview', solve('thumbnail', [('preview-click', N), ('close-preview', N)], N), 'canceled')
check('trace content-ready then decode-success', solve('fetching', [('content-ready', N), ('decode-success', N)], N), 'open')
check('trace content-ready then decode-failure', solve('fetching', [('content-ready', N), ('decode-failure', N)], N), 'decode-error')
check('trace decode-success then close-preview', solve('decoding', [('decode-success', N), ('close-preview', N)], N), 'thumbnail')
check('trace decode-failure then download-original', solve('decoding', [('decode-failure', N), ('download-original', N)], N), 'download-pending')
check('trace fetch-failure then retry-fetch', solve('fetching', [('fetch-failure', N), ('retry-fetch', N)], N), 'fetching')
check('trace retry-fetch then content-ready', solve('fetch-error', [('retry-fetch', N), ('content-ready', N)], N), 'decoding')
check('trace retry-fetch then fetch-failure', solve('fetch-error', [('retry-fetch', N), ('fetch-failure', N)], N), 'fetch-error')
check('trace retry-fetch then close-preview', solve('fetch-error', [('retry-fetch', N), ('close-preview', N)], N), 'canceled')
check('trace close-preview then preview-click', solve('open', [('close-preview', N), ('preview-click', N)], N), 'fetching')
check('trace close-preview then late-content-ready', solve('fetching', [('close-preview', N), ('late-content-ready', N)], N), 'thumbnail')
check('trace late-content-ready then preview-click', solve('canceled', [('late-content-ready', N), ('preview-click', N)], N), 'fetching')
check('domain state regression 1: bytes', solve('fetching', [('content-ready', N, {'attachment': 'old', 'bytes': 7})], N, {}, 'bytes'), {'phase': 'fetching', 'value': 0})
check('domain state regression 2: bytes', solve('fetching', [('content-ready', N, {'bytes': 7})], N, {}, 'bytes'), {'phase': 'decoding', 'value': 7})
check('domain state regression 3: decoded', solve('decoding', [('decode-success', N, {'require_bytes': True})], N, {}, 'decoded'), {'phase': 'decode-error', 'value': False})
check('domain state regression 4: decoded', solve('decoding', [('decode-success', N, {'require_bytes': True})], N, {'bytes': 7}, 'decoded'), {'phase': 'open', 'value': True})
check('domain state regression 5: download', solve('decode-error', [('download-original', N, {})], N, {}, 'download'), {'phase': 'download-pending', 'value': ['photo']})
check('domain state regression 6: decoded', solve('open', [('close-preview', N, {})], N, {'decoded': True}, 'decoded'), {'phase': 'thumbnail', 'value': False})
check('domain state regression 7: decoded', solve('thumbnail', [('preview-click', N, {}), ('content-ready', N, {'bytes': 8}), ('decode-success', N, {'require_bytes': True}), ('close-preview', N, {})], N, {}, 'decoded'), {'phase': 'thumbnail', 'value': False})
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 fixtureActualExpectedOutcome
thumbnail / preview-clickfetchingfetchingPassed
fetching / content-readydecodingdecodingPassed
decoding / decode-successopenopenPassed
decoding / decode-failuredecode-errordecode-errorPassed
fetching / fetch-failurefetch-errorfetch-errorPassed
fetch-error / retry-fetchfetchingfetchingPassed
open / close-previewthumbnailthumbnailPassed
fetching / close-previewcanceledcanceledPassed
canceled / late-content-readythumbnailthumbnailPassed
decode-error / download-originalfetchingdownload-pendingFailed
older notification incarnationthumbnailthumbnailPassed
future notification incarnationthumbnailthumbnailPassed
unknown event is inertthumbnailthumbnailPassed
empty delivery batchthumbnailthumbnailPassed
N stale deliveries before current deliveryfetchingfetchingPassed
trace preview-click then content-readydecodingdecodingPassed
trace preview-click then fetch-failurefetch-errorfetch-errorPassed
trace preview-click then close-previewcanceledcanceledPassed
trace content-ready then decode-successopenopenPassed
trace content-ready then decode-failuredecode-errordecode-errorPassed
trace decode-success then close-previewthumbnailthumbnailPassed
trace decode-failure then download-originalfetchingdownload-pendingFailed
trace fetch-failure then retry-fetchfetchingfetchingPassed
trace retry-fetch then content-readydecodingdecodingPassed
trace retry-fetch then fetch-failurefetch-errorfetch-errorPassed
trace retry-fetch then close-previewcanceledcanceledPassed
trace close-preview then preview-clickfetchingfetchingPassed
trace close-preview then late-content-readythumbnailthumbnailPassed
trace late-content-ready then preview-clickfetchingfetchingPassed
domain state regression 1: bytes{'phase': 'fetching', 'value': 0}{'phase': 'fetching', 'value': 0}Passed
domain state regression 2: bytes{'phase': 'decoding', 'value': 7}{'phase': 'decoding', 'value': 7}Passed
domain state regression 3: decoded{'phase': 'decode-error', 'value': False}{'phase': 'decode-error', 'value': False}Passed
domain state regression 4: decoded{'phase': 'open', 'value': True}{'phase': 'open', 'value': True}Passed
domain state regression 5: download{'phase': 'fetching', 'value': []}{'phase': 'download-pending', 'value': ['photo']}Failed
domain state regression 6: decoded{'phase': 'thumbnail', 'value': False}{'phase': 'thumbnail', 'value': False}Passed
domain state regression 7: decoded{'phase': 'thumbnail', 'value': False}{'phase': 'thumbnail', 'value': False}Passed

SHA-256 / 7b3b11ca160d8d3ea2cfb5eeaa72a0b33eaeb8d859215f000709c49e051f53ff

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 36 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 single-notification state and policy model only. Event delivery and acknowledgements are explicit test inputs. No DOM, accessibility announcements, live timers, networking, actual rendering, or production-platform conformance is simulated. 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:42:31.391884+00:00.

Case digest / 9401f3108e57d1c24080fcec04477b204d23031f2881b13ce3070f6f8c08ebdc