The Wire · Showcase
ECTO FIXES SILENT DATA CORRUPTION IN MAP UPDATES AND BELONGS_TO LOOKUPS
By RepoJournal · Filed · About Elixir & Phoenix
Two critical Ecto bugs that silently corrupt changeset data are now fixed, and you should merge these immediately if you're using map or association updates.
Ecto shipped fixes for two separate but equally dangerous changesets bugs that ship silently into production. The first [1] fixes map update source field caching, where field changes weren't being tracked correctly on subsequent operations. The second [2] addresses stale belongs_to keys in apply_changes, which could cause association lookups to reference outdated data after a changeset is applied. Both bugs corrupt data without raising errors, so any application using maps or belongs_to relationships should verify your current behavior immediately.
On the Elixir side, the core language shipped three quality-of-life fixes. An inspect optimization [3] cuts memory allocations in keyword and map inspection by 1.3x to 1.7x through a simple atom binary trick that beats the old charlist approach. ExUnit also got two fixes: one [4] corrected swapped documentation defaults for diff coloring, and another [5] fixed EventManager incorrectly calling Supervisor instead of DynamicSupervisor, a type safety miss that should be harder to make as typed supervision hardens.
Action items
- → Merge Ecto #4758 and #4756 immediately - these fix silent data corruption elixir-ecto/ecto [immediate]
- → Audit recent changesets using map updates or belongs_to associations for data inconsistencies elixir-ecto/ecto [immediate]
- → Pull the inspect optimization in your next Elixir upgrade cycle elixir-lang/elixir [plan]
References
- [1] Fix map update source field caching ↗ elixir-ecto/ecto
- [2] Fix stale belongs_to key in apply_changes ↗ elixir-ecto/ecto
- [3] Optimize Inspect.List.keyword?/1 by using Atom.to_string/1 (#15631) elixir-lang/elixir
- [4] Fix ExUnit configure_opts swapped doc defaults (#15634) elixir-lang/elixir
- [5] Fix ExUnit.EventManager calling Supervisor on DynamicSupervisor (#15633) elixir-lang/elixir