SoloMedium8m
The Lost Update
Product Support — silent catalog overwrite
Enterprise customer: Admin Alice updated 200 products overnight. Half reverted — Bob saved after her with a blind UPDATE. No error, no conflict warning.
The trap: Last-write-wins — Bob's save used stale data and overwrote Alice's title change.
Your task
Implement optimistic locking in `product_service.py`: get_product_safe() returns version; update_product_safe() checks expected_version via db.update_product(); compare_versions() reports conflict fields on 409-style CONFLICT.
Book: UPDATE sets new values · Prod: WHERE version = ? prevents silent lost updates.
Skills you'll prove
pythonconcurrencyoptimistic-lockingdatabasedata-integritybook-vs-prod