[WC-3520]: Gallery recover from stale sort-order attribute id - #2372
[WC-3520]: Gallery recover from stale sort-order attribute id#2372yordan-st wants to merge 1 commit into
Conversation
b0c433e to
b00dec8
Compare
AI Code Review
What was reviewed
Skipped (out of scope): All CI checks could not be retrieved (approval required) — please verify green before merge. Findings
|
|
|
||
| This guard SHALL apply on the path every sort order takes into the datasource, regardless of whether a sort widget (DropdownSort) is configured — i.e. it SHALL NOT depend on a `SortOrderStore` being instantiated. | ||
|
|
||
| #### Scenario: Restored sort order contains a stale attribute id |
There was a problem hiding this comment.
Is it really the case that framework is supplying us with outdated sorting information? We have to let the framework team know so they can fix it us well. Can you confirm this is the case and create a trivial reproduction code for it?
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Gallery crashed with an uncaught MobX reaction error —
Sort order item: invalid attribute id '<id>'— when a sort order restored fromdatasource.sortOrderreferenced an attribute id no longer valid in the current app build. Mendix attribute ids are per-build tokens regenerated on redeploy, so a sort order persisted per-user (personalization attribute / DB storage) can outlive the ids it references.QueryParamsServicenow guards the forwarding of sort order intoListValue.setSortOrder(): on a runtime rejection it catches the error, falls back to the default (unsorted) order, and emits aconsole.warnso the reset is diagnosable. The guard sits on the shared forwarding path (the sort reaction), so it protects the widget whether or not a sort widget is configured — theSortOrderStoreis not instantiated when no DropdownSort exists, which is why the fix is not there.Ticket: WC-3520
What should be covered while testing?
invalid attribute iduncaught reaction error.console.warnlogged.