FA-34021 / Notification interfaces / Open access
Inbox read receipt rendering: mark-unread from read-confirmed · case 01
The mark-unread event leaves a notification in unread instead of unread-pending.
ROOT CAUSE
Unread styling becomes durable before the write succeeds.
THE FAILURE
Unread styling becomes durable before the write succeeds.
Unsuccessful approach: Reusing the read request state sends the opposite intent.
Case contract
Inbox read receipt rendering is a bounded visual-notification workflow with mutable policy state {'revision': 2, 'ack_revision': 0, 'unread_ids': ['n', 'other'], 'item': 'n'}. Its default transition relation is {('unread', 'open-preview'): 'previewing', ('previewing', 'close-preview'): 'unread', ('previewing', 'mark-read'): 'read-pending', ('read-pending', 'receipt-accepted'): 'read-confirmed', ('read-pending', 'receipt-rejected'): 'read-error', ('read-error', 'retry-receipt'): 'read-pending', ('read-confirmed', 'mark-unread'): 'unread-pending', ('unread-pending', 'unread-accepted'): 'unread', ('unread-pending', 'unread-rejected'): 'unread-error', ('unread-error', 'dismiss-error'): 'read-confirmed'}; 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 = {('unread', 'open-preview'): 'previewing', ('previewing', 'close-preview'): 'unread', ('previewing', 'mark-read'): 'read-pending', ('read-pending', 'receipt-accepted'): 'read-confirmed', ('read-pending', 'receipt-rejected'): 'read-error', ('read-error', 'retry-receipt'): 'read-pending', ('read-confirmed', 'mark-unread'): 'unread', ('unread-pending', 'unread-accepted'): 'unread', ('unread-pending', 'unread-rejected'): 'unread-error', ('unread-error', 'dismiss-error'): 'read-confirmed'}
data = json.loads(json.dumps({'revision': 2, 'ack_revision': 0, 'unread_ids': ['n', 'other'], 'item': 'n'})) if payload is None else {**json.loads(json.dumps({'revision': 2, 'ack_revision': 0, 'unread_ids': ['n', 'other'], 'item': 'n'})), **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 ('receipt-accepted','receipt-rejected','unread-accepted','unread-rejected') and arg.get('revision',data['revision']) != data['revision']: event = 'unknown-event'
state = table.get((state, event), state)
if state == 'read-confirmed':
data['ack_revision'] = data['revision']
data['unread_ids'] = [x for x in data['unread_ids'] if x != data['item']]
if state == 'unread' and data['item'] not in data['unread_ids']: data['unread_ids'].append(data['item'])
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('unread / open-preview', solve('unread', [('open-preview', N)], N), 'previewing')
check('previewing / close-preview', solve('previewing', [('close-preview', N)], N), 'unread')
check('previewing / mark-read', solve('previewing', [('mark-read', N)], N), 'read-pending')
check('read-pending / receipt-accepted', solve('read-pending', [('receipt-accepted', N)], N), 'read-confirmed')
check('read-pending / receipt-rejected', solve('read-pending', [('receipt-rejected', N)], N), 'read-error')
check('read-error / retry-receipt', solve('read-error', [('retry-receipt', N)], N), 'read-pending')
check('read-confirmed / mark-unread', solve('read-confirmed', [('mark-unread', N)], N), 'unread-pending')
check('unread-pending / unread-accepted', solve('unread-pending', [('unread-accepted', N)], N), 'unread')
check('unread-pending / unread-rejected', solve('unread-pending', [('unread-rejected', N)], N), 'unread-error')
check('unread-error / dismiss-error', solve('unread-error', [('dismiss-error', N)], N), 'read-confirmed')
check('older notification incarnation', solve('unread', [('open-preview', N - 1)], N), 'unread')
check('future notification incarnation', solve('unread', [('open-preview', N + 1)], N), 'unread')
check('unknown event is inert', solve('unread', [('unknown-event', N)], N), 'unread')
check('empty delivery batch', solve('unread', [], N), 'unread')
check('N stale deliveries before current delivery', solve('unread', [('open-preview', N - 1)] * N + [('open-preview', N)], N), 'previewing')
check('trace open-preview then close-preview', solve('unread', [('open-preview', N), ('close-preview', N)], N), 'unread')
check('trace open-preview then mark-read', solve('unread', [('open-preview', N), ('mark-read', N)], N), 'read-pending')
check('trace close-preview then open-preview', solve('previewing', [('close-preview', N), ('open-preview', N)], N), 'previewing')
check('trace mark-read then receipt-accepted', solve('previewing', [('mark-read', N), ('receipt-accepted', N)], N), 'read-confirmed')
check('trace mark-read then receipt-rejected', solve('previewing', [('mark-read', N), ('receipt-rejected', N)], N), 'read-error')
check('trace receipt-accepted then mark-unread', solve('read-pending', [('receipt-accepted', N), ('mark-unread', N)], N), 'unread-pending')
check('trace receipt-rejected then retry-receipt', solve('read-pending', [('receipt-rejected', N), ('retry-receipt', N)], N), 'read-pending')
check('trace retry-receipt then receipt-accepted', solve('read-error', [('retry-receipt', N), ('receipt-accepted', N)], N), 'read-confirmed')
check('trace retry-receipt then receipt-rejected', solve('read-error', [('retry-receipt', N), ('receipt-rejected', N)], N), 'read-error')
check('trace mark-unread then unread-accepted', solve('read-confirmed', [('mark-unread', N), ('unread-accepted', N)], N), 'unread')
check('trace mark-unread then unread-rejected', solve('read-confirmed', [('mark-unread', N), ('unread-rejected', N)], N), 'unread-error')
check('trace unread-accepted then open-preview', solve('unread-pending', [('unread-accepted', N), ('open-preview', N)], N), 'previewing')
check('trace unread-rejected then dismiss-error', solve('unread-pending', [('unread-rejected', N), ('dismiss-error', N)], N), 'read-confirmed')
check('trace dismiss-error then mark-unread', solve('unread-error', [('dismiss-error', N), ('mark-unread', N)], N), 'unread-pending')
check('domain state regression 1: ack_revision', solve('read-pending', [('receipt-accepted', N, {'revision': 1})], N, {}, 'ack_revision'), {'phase': 'read-pending', 'value': 0})
check('domain state regression 2: ack_revision', solve('read-pending', [('receipt-accepted', N, {'revision': 2})], N, {}, 'ack_revision'), {'phase': 'read-confirmed', 'value': 2})
check('domain state regression 3: unread_ids', solve('read-pending', [('receipt-accepted', N, {})], N, {}, 'unread_ids'), {'phase': 'read-confirmed', 'value': ['other']})
check('domain state regression 4: unread_ids', solve('unread-pending', [('unread-accepted', N, {})], N, {'unread_ids': ['other']}, 'unread_ids'), {'phase': 'unread', 'value': ['other', 'n']})
check('domain state regression 5: unread_ids', solve('unread', [('open-preview', N, {})], N, {}, 'unread_ids'), {'phase': 'previewing', 'value': ['n', 'other']})
check('domain state regression 6: unread_ids', solve('unread-pending', [('unread-accepted', N, {'revision': 1})], N, {'unread_ids': ['other']}, 'unread_ids'), {'phase': 'unread-pending', 'value': ['other']})
check('domain state regression 7: unread_ids', solve('unread', [('open-preview', N, {}), ('mark-read', N, {}), ('receipt-accepted', N, {'revision': 1}), ('receipt-accepted', N, {'revision': 2})], N, {}, 'unread_ids'), {'phase': 'read-confirmed', 'value': ['other']})
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 |
|---|---|---|---|
| unread / open-preview | previewing | previewing | Passed |
| previewing / close-preview | unread | unread | Passed |
| previewing / mark-read | read-pending | read-pending | Passed |
| read-pending / receipt-accepted | read-confirmed | read-confirmed | Passed |
| read-pending / receipt-rejected | read-error | read-error | Passed |
| read-error / retry-receipt | read-pending | read-pending | Passed |
| read-confirmed / mark-unread | unread | unread-pending | Failed |
| unread-pending / unread-accepted | unread | unread | Passed |
| unread-pending / unread-rejected | unread-error | unread-error | Passed |
| unread-error / dismiss-error | read-confirmed | read-confirmed | Passed |
| older notification incarnation | unread | unread | Passed |
| future notification incarnation | unread | unread | Passed |
| unknown event is inert | unread | unread | Passed |
| empty delivery batch | unread | unread | Passed |
| N stale deliveries before current delivery | previewing | previewing | Passed |
| trace open-preview then close-preview | unread | unread | Passed |
| trace open-preview then mark-read | read-pending | read-pending | Passed |
| trace close-preview then open-preview | previewing | previewing | Passed |
| trace mark-read then receipt-accepted | read-confirmed | read-confirmed | Passed |
| trace mark-read then receipt-rejected | read-error | read-error | Passed |
| trace receipt-accepted then mark-unread | unread | unread-pending | Failed |
| trace receipt-rejected then retry-receipt | read-pending | read-pending | Passed |
| trace retry-receipt then receipt-accepted | read-confirmed | read-confirmed | Passed |
| trace retry-receipt then receipt-rejected | read-error | read-error | Passed |
| trace mark-unread then unread-accepted | unread | unread | Passed |
| trace mark-unread then unread-rejected | unread | unread-error | Failed |
| trace unread-accepted then open-preview | previewing | previewing | Passed |
| trace unread-rejected then dismiss-error | read-confirmed | read-confirmed | Passed |
| trace dismiss-error then mark-unread | unread | unread-pending | Failed |
| domain state regression 1: ack_revision | {'phase': 'read-pending', 'value': 0} | {'phase': 'read-pending', 'value': 0} | Passed |
| domain state regression 2: ack_revision | {'phase': 'read-confirmed', 'value': 2} | {'phase': 'read-confirmed', 'value': 2} | Passed |
| domain state regression 3: unread_ids | {'phase': 'read-confirmed', 'value': ['other']} | {'phase': 'read-confirmed', 'value': ['other']} | Passed |
| domain state regression 4: unread_ids | {'phase': 'unread', 'value': ['other', 'n']} | {'phase': 'unread', 'value': ['other', 'n']} | Passed |
| domain state regression 5: unread_ids | {'phase': 'previewing', 'value': ['n', 'other']} | {'phase': 'previewing', 'value': ['n', 'other']} | Passed |
| domain state regression 6: unread_ids | {'phase': 'unread-pending', 'value': ['other']} | {'phase': 'unread-pending', 'value': ['other']} | Passed |
| domain state regression 7: unread_ids | {'phase': 'read-confirmed', 'value': ['other']} | {'phase': 'read-confirmed', 'value': ['other']} | Passed |
SHA-256 / ae93908a0f86ef536630a9425e089025678c02044a9339f3caec17404eea760a
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 = {('unread', 'open-preview'): 'previewing', ('previewing', 'close-preview'): 'unread', ('previewing', 'mark-read'): 'read-pending', ('read-pending', 'receipt-accepted'): 'read-confirmed', ('read-pending', 'receipt-rejected'): 'read-error', ('read-error', 'retry-receipt'): 'read-pending', ('read-confirmed', 'mark-unread'): 'read-pending', ('unread-pending', 'unread-accepted'): 'unread', ('unread-pending', 'unread-rejected'): 'unread-error', ('unread-error', 'dismiss-error'): 'read-confirmed'}
data = json.loads(json.dumps({'revision': 2, 'ack_revision': 0, 'unread_ids': ['n', 'other'], 'item': 'n'})) if payload is None else {**json.loads(json.dumps({'revision': 2, 'ack_revision': 0, 'unread_ids': ['n', 'other'], 'item': 'n'})), **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 ('receipt-accepted','receipt-rejected','unread-accepted','unread-rejected') and arg.get('revision',data['revision']) != data['revision']: event = 'unknown-event'
state = table.get((state, event), state)
if state == 'read-confirmed':
data['ack_revision'] = data['revision']
data['unread_ids'] = [x for x in data['unread_ids'] if x != data['item']]
if state == 'unread' and data['item'] not in data['unread_ids']: data['unread_ids'].append(data['item'])
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('unread / open-preview', solve('unread', [('open-preview', N)], N), 'previewing')
check('previewing / close-preview', solve('previewing', [('close-preview', N)], N), 'unread')
check('previewing / mark-read', solve('previewing', [('mark-read', N)], N), 'read-pending')
check('read-pending / receipt-accepted', solve('read-pending', [('receipt-accepted', N)], N), 'read-confirmed')
check('read-pending / receipt-rejected', solve('read-pending', [('receipt-rejected', N)], N), 'read-error')
check('read-error / retry-receipt', solve('read-error', [('retry-receipt', N)], N), 'read-pending')
check('read-confirmed / mark-unread', solve('read-confirmed', [('mark-unread', N)], N), 'unread-pending')
check('unread-pending / unread-accepted', solve('unread-pending', [('unread-accepted', N)], N), 'unread')
check('unread-pending / unread-rejected', solve('unread-pending', [('unread-rejected', N)], N), 'unread-error')
check('unread-error / dismiss-error', solve('unread-error', [('dismiss-error', N)], N), 'read-confirmed')
check('older notification incarnation', solve('unread', [('open-preview', N - 1)], N), 'unread')
check('future notification incarnation', solve('unread', [('open-preview', N + 1)], N), 'unread')
check('unknown event is inert', solve('unread', [('unknown-event', N)], N), 'unread')
check('empty delivery batch', solve('unread', [], N), 'unread')
check('N stale deliveries before current delivery', solve('unread', [('open-preview', N - 1)] * N + [('open-preview', N)], N), 'previewing')
check('trace open-preview then close-preview', solve('unread', [('open-preview', N), ('close-preview', N)], N), 'unread')
check('trace open-preview then mark-read', solve('unread', [('open-preview', N), ('mark-read', N)], N), 'read-pending')
check('trace close-preview then open-preview', solve('previewing', [('close-preview', N), ('open-preview', N)], N), 'previewing')
check('trace mark-read then receipt-accepted', solve('previewing', [('mark-read', N), ('receipt-accepted', N)], N), 'read-confirmed')
check('trace mark-read then receipt-rejected', solve('previewing', [('mark-read', N), ('receipt-rejected', N)], N), 'read-error')
check('trace receipt-accepted then mark-unread', solve('read-pending', [('receipt-accepted', N), ('mark-unread', N)], N), 'unread-pending')
check('trace receipt-rejected then retry-receipt', solve('read-pending', [('receipt-rejected', N), ('retry-receipt', N)], N), 'read-pending')
check('trace retry-receipt then receipt-accepted', solve('read-error', [('retry-receipt', N), ('receipt-accepted', N)], N), 'read-confirmed')
check('trace retry-receipt then receipt-rejected', solve('read-error', [('retry-receipt', N), ('receipt-rejected', N)], N), 'read-error')
check('trace mark-unread then unread-accepted', solve('read-confirmed', [('mark-unread', N), ('unread-accepted', N)], N), 'unread')
check('trace mark-unread then unread-rejected', solve('read-confirmed', [('mark-unread', N), ('unread-rejected', N)], N), 'unread-error')
check('trace unread-accepted then open-preview', solve('unread-pending', [('unread-accepted', N), ('open-preview', N)], N), 'previewing')
check('trace unread-rejected then dismiss-error', solve('unread-pending', [('unread-rejected', N), ('dismiss-error', N)], N), 'read-confirmed')
check('trace dismiss-error then mark-unread', solve('unread-error', [('dismiss-error', N), ('mark-unread', N)], N), 'unread-pending')
check('domain state regression 1: ack_revision', solve('read-pending', [('receipt-accepted', N, {'revision': 1})], N, {}, 'ack_revision'), {'phase': 'read-pending', 'value': 0})
check('domain state regression 2: ack_revision', solve('read-pending', [('receipt-accepted', N, {'revision': 2})], N, {}, 'ack_revision'), {'phase': 'read-confirmed', 'value': 2})
check('domain state regression 3: unread_ids', solve('read-pending', [('receipt-accepted', N, {})], N, {}, 'unread_ids'), {'phase': 'read-confirmed', 'value': ['other']})
check('domain state regression 4: unread_ids', solve('unread-pending', [('unread-accepted', N, {})], N, {'unread_ids': ['other']}, 'unread_ids'), {'phase': 'unread', 'value': ['other', 'n']})
check('domain state regression 5: unread_ids', solve('unread', [('open-preview', N, {})], N, {}, 'unread_ids'), {'phase': 'previewing', 'value': ['n', 'other']})
check('domain state regression 6: unread_ids', solve('unread-pending', [('unread-accepted', N, {'revision': 1})], N, {'unread_ids': ['other']}, 'unread_ids'), {'phase': 'unread-pending', 'value': ['other']})
check('domain state regression 7: unread_ids', solve('unread', [('open-preview', N, {}), ('mark-read', N, {}), ('receipt-accepted', N, {'revision': 1}), ('receipt-accepted', N, {'revision': 2})], N, {}, 'unread_ids'), {'phase': 'read-confirmed', 'value': ['other']})
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 |
|---|---|---|---|
| unread / open-preview | previewing | previewing | Passed |
| previewing / close-preview | unread | unread | Passed |
| previewing / mark-read | read-pending | read-pending | Passed |
| read-pending / receipt-accepted | read-confirmed | read-confirmed | Passed |
| read-pending / receipt-rejected | read-error | read-error | Passed |
| read-error / retry-receipt | read-pending | read-pending | Passed |
| read-confirmed / mark-unread | read-pending | unread-pending | Failed |
| unread-pending / unread-accepted | unread | unread | Passed |
| unread-pending / unread-rejected | unread-error | unread-error | Passed |
| unread-error / dismiss-error | read-confirmed | read-confirmed | Passed |
| older notification incarnation | unread | unread | Passed |
| future notification incarnation | unread | unread | Passed |
| unknown event is inert | unread | unread | Passed |
| empty delivery batch | unread | unread | Passed |
| N stale deliveries before current delivery | previewing | previewing | Passed |
| trace open-preview then close-preview | unread | unread | Passed |
| trace open-preview then mark-read | read-pending | read-pending | Passed |
| trace close-preview then open-preview | previewing | previewing | Passed |
| trace mark-read then receipt-accepted | read-confirmed | read-confirmed | Passed |
| trace mark-read then receipt-rejected | read-error | read-error | Passed |
| trace receipt-accepted then mark-unread | read-pending | unread-pending | Failed |
| trace receipt-rejected then retry-receipt | read-pending | read-pending | Passed |
| trace retry-receipt then receipt-accepted | read-confirmed | read-confirmed | Passed |
| trace retry-receipt then receipt-rejected | read-error | read-error | Passed |
| trace mark-unread then unread-accepted | read-pending | unread | Failed |
| trace mark-unread then unread-rejected | read-pending | unread-error | Failed |
| trace unread-accepted then open-preview | previewing | previewing | Passed |
| trace unread-rejected then dismiss-error | read-confirmed | read-confirmed | Passed |
| trace dismiss-error then mark-unread | read-pending | unread-pending | Failed |
| domain state regression 1: ack_revision | {'phase': 'read-pending', 'value': 0} | {'phase': 'read-pending', 'value': 0} | Passed |
| domain state regression 2: ack_revision | {'phase': 'read-confirmed', 'value': 2} | {'phase': 'read-confirmed', 'value': 2} | Passed |
| domain state regression 3: unread_ids | {'phase': 'read-confirmed', 'value': ['other']} | {'phase': 'read-confirmed', 'value': ['other']} | Passed |
| domain state regression 4: unread_ids | {'phase': 'unread', 'value': ['other', 'n']} | {'phase': 'unread', 'value': ['other', 'n']} | Passed |
| domain state regression 5: unread_ids | {'phase': 'previewing', 'value': ['n', 'other']} | {'phase': 'previewing', 'value': ['n', 'other']} | Passed |
| domain state regression 6: unread_ids | {'phase': 'unread-pending', 'value': ['other']} | {'phase': 'unread-pending', 'value': ['other']} | Passed |
| domain state regression 7: unread_ids | {'phase': 'read-confirmed', 'value': ['other']} | {'phase': 'read-confirmed', 'value': ['other']} | Passed |
SHA-256 / f23b67bc824f27575f8cc77415f5b23d5c9b60d6b18b89b715cf17cd07aeb01a
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:28.010820+00:00.
Case digest / 34209daee64e08b33f6c3706fd3294d0f091ee7557949164aa55f104258386e2