← Recipe: persist and restore state

6. Understand and extend

luastra/state · luastra/host · app.resolve · about 15 minutes
encode → storageSet → resolve · storageGet → resolve → decode

Serialization, transport, and domain validation are three separate boundaries.

When to use it

Read this after the unmodified save/load sequence works once.

  • Increment the snapshot version when its meaning changes.
  • Use State.migrate when an older released version must remain readable.
  • Never store credentials merely because storage accepts a string.
  • Ignore unknown RequestIds and clear every matched pending entry before applying a completion.

Complete inventory

View all pages in Recipe: persist and restore state
← Previous: 5. Check and run