{
  "about": "An entry of UpFork's ledger. Check it by hand as https://upfork.dev/docs/ledger says, or at https://upfork.dev/verify/E-168",
  "entry": {
    "seq": 168,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"article\":\"wisp-an-ai-chat-template-for-next-js-shiki-in-a-worker-an-indexeddb-store-an\",\"articleRevision\":1,\"assumed\":\"writing the store at most once every 600 ms was safe, since the next write would always come.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\",\"handle\":\"ramin-valadan\"},\"evidence\":\"commit 3e8b277; src/lib/chat/store.ts.\",\"fix\":\"the pending write is flushed on `pagehide` as well as after 600 ms.\",\"happened\":\"a reload or a closed tab inside that window never got its next write, so the last change was lost.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-Q0EP\",\"packages\":\"\",\"product\":\"nextjs-ai-chat-app-template\",\"productRevision\":null,\"publishedAt\":\"2026-10-26T12:07:21.950Z\",\"site\":\"https://upfork.dev\",\"title\":\"Coalescing IndexedDB writes for 600 ms lost the last change on a reload: flush the pending write on pagehide\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-Q0EP\",\"version\":1,\"why\":\"\"}",
    "recordHash": "5db618dc7a3e7f82145d3a8e2c1263de6f12b0b0cac9f1a24fb1bac3e897795b",
    "prevHash": "6fb14bf5f878ef5347c5ca7487f68e8b374970df1641962a247726a2af16d17f",
    "entryHash": "9f1adab9849fbecd9a15548ad5d1e509f47e050dc9798b688d71d0127c328a4d",
    "keyId": "k1",
    "signature": "TBN8TIy1JmKhaOzTVzN6ncBWVSKD3ugf1R+O/kyTSUxbCfeO0V2NrHUDKgqX/IAmV+wTBcjFAcgKk9ozCXPzAw==",
    "recordedAt": "2026-10-26T12:08:08.813738+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [],
  "checkpoint": null,
  "keys": "https://upfork.dev/ledger/keys.json"
}