You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release 0.10.2: three entity-manager and schema-mapper fixes
All three are behind non-default features or affect types a default build never
reaches, so nothing here changes a default-feature project.
Two unsaved entities registered with an entity manager aliased each other.
`tide_pk_key` is infallible and has no notion of "unsaved", so a default primary
key renders as an ordinary string — "0" for an i64. `register` and `put` filed
entities under it, so the second new instance of a model collided with the first
and was handed the first one back: a `HasMany` holding two new children silently
dropped one and inserted the other twice. `TideEntityManagerMeta` gains
`tide_pk_is_new`, defaulting to false so hand-written impls are unaffected, and
both call sites return early rather than aliasing.
`persist` left an identity-map entry no path could remove. `persisted_key`
answered two different questions — whether a row exists in the database, and
which key the entry is filed under in the identity map. They diverge for an
entity given to `persist` with a client-assigned primary key, which is trackable
immediately but not yet inserted. All three removal paths keyed off
`persisted_key`, so `detach` silently did nothing and `remove` plus a flush left
`find_managed` returning a row that was never written. The map key is now its own
field, threaded through flush, detach and checkpoint rollback; the DELETE stays
gated on whether a row actually exists.
`Text` and `JsonArray` are exported from `tideorm::types` and documented as model
field types, and `canonical_schema_type` already normalised both names, but
neither had an arm in the `ColumnType` match — so both reached the catch-all and
failed to compile.
Four regression tests, each checked to fail against the unfixed code. They are
deliberately database-free: the entity-manager ones use a disconnected handle,
and the removal test drives the entry's own flush rather than
`EntityManager::flush`, which opens a transaction. Putting database-requiring
tests in the lib suite is what broke CI two releases ago.
0 commit comments