ErrorsEntities, stores and migrations · rule
data.expiry_unexpected
An entity kept in a database says with expires_after: when its records expire, which only an entity in Redis does.
Area 5, Entities, stores and migrations; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
A database keeps a record until something deletes it. Only an entity
kept in Redis, for data that is short-lived and harmless to lose, says
how long its records live. A record in a database that should go after a
while is deleted by its lifecycle's purge: or by a retention:, which
say what goes and record it.
What it looks like
domains/accounts/entities/sign_up_draft.jadpo:
/// A sign-up someone has started and not yet finished.entity SignUpDraft { id: Uuid email: Email expires_after: 2h}
error SignUpDraft is kept in a database, where records don't expire
--> domains/accounts/entities/sign_up_draft.jadpo:6:5
|6 | expires_after: 2h | ^^^^^^^^^^^^^ only an entity in Redis expires
- reason
mainis a PostgreSQL store, which keeps a record until something deletes it. Only an entity kept in Redis, for data that is short-lived and harmless to lose, says how long its records live. A record that should go after a while is deleted by a lifecycle'spurge:or aretention:.- next
- Remove
expires_after:fromSignUpDraft, or keep it in a Redis store (agent) - rule
- data.
expiry_ unexpected - help
- https://jadpo.
dev/docs/errors/data. expiry_ unexpected
(agent) at the end of the next: line means your coding agent can make
the fix itself.
How to fix it
If the records belong in the database, remove expires_after:.
domains/accounts/entities/sign_up_draft.jadpo becomes:
/// A sign-up someone has started and not yet finished.entity SignUpDraft { id: Uuid email: Email}
A record now stays until something deletes it; a retention: deletes
them after a while
(Retention).
If they are short-lived and harmless to lose, keep the entity in a Redis store:
entity SignUpDraft { ... store: drafts expires_after: 2h}
A sign-up nobody touches for two hours is gone from Redis.
Related
Markdown for agents: /docs/errors/data.expiry_unexpected.md.Built from Jadpo's main branch at commit 9080dc3.