Commit 5143081
fix(core): TRAC-281 Prevent breadcrumb array mutation on cached web pages
`.reverse()` was called directly on the breadcrumbs array returned from
React's `cache()`, mutating the shared reference. When `generateMetadata`
and `getWebPageBreadcrumbs` raced during render, the cached array could
be in reversed order, causing parent breadcrumb entries to disappear.
Also fix off-by-one in `truncateBreadcrumbs` where arrays exactly at the
target length were incorrectly truncated, replacing the middle item with
an ellipsis.
Fixes TRAC-281
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a8dd99e commit 5143081
3 files changed
Lines changed: 3 additions & 3 deletions
File tree
- core
- app/[locale]/(default)/webpages/[id]
- contact
- normal
- data-transformers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments