Skip to content

fix(database): prevent deeply nested has many map adding extra empty object#1995

Draft
nunntom wants to merge 3 commits intotempestphp:3.xfrom
nunntom:deeply-nested-has-many-map-bug
Draft

fix(database): prevent deeply nested has many map adding extra empty object#1995
nunntom wants to merge 3 commits intotempestphp:3.xfrom
nunntom:deeply-nested-has-many-map-bug

Conversation

@nunntom
Copy link

@nunntom nunntom commented Feb 19, 2026

closes #1994

  • Added failing assertion to existing test showing the bug
  • Removed line in SelectModelMapper that adds initial empty model. It doesn't seem necessary since the later $data->set adds the full nested path anyway. Please correct me if I'm wrong or if I broke anything. Tests are all still passing (including the failing one I added).

@brendt brendt marked this pull request as draft March 9, 2026 08:22
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Benchmark Results

Comparison of deeply-nested-has-many-map-bug against 3.x (5563eac1332581f39b908f0e4b23adf53167c282).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ViewRenderBench(benchPlainHtml) - 21.481mb 0.00% 488.857μs -5.87% ±3.67% +27.95%

Generated by phpbench against commit 7c8dee2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deeply nested has-many map creates additional empty relation object

1 participant