Skip to content

CardView - Header filter search is only triggered once when remoteOperations is true (T1305672)#33899

Open
markallenramirez wants to merge 2 commits into
DevExpress:26_1from
markallenramirez:bug_T1305672/26_1
Open

CardView - Header filter search is only triggered once when remoteOperations is true (T1305672)#33899
markallenramirez wants to merge 2 commits into
DevExpress:26_1from
markallenramirez:bug_T1305672/26_1

Conversation

@markallenramirez

Copy link
Copy Markdown
Contributor

No description provided.

@markallenramirez markallenramirez self-assigned this Jun 8, 2026
Copilot AI review requested due to automatic review settings June 8, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CardView/grid “new” DataController deferred caching behavior so cache hits are less likely to occur when call arguments differ only in deeper nested properties—addressing cases where header filter search with remoteOperations: true was only triggering once.

Changes:

  • Adjusted deferredCache argument equality check to use equalByValue(..., { maxDepth: 5 }) instead of the default depth.
  • Ensures deeper load-option changes are detected and do not incorrectly reuse cached results.

@markallenramirez markallenramirez requested a review from a team June 9, 2026 06:56
@Alyar666 Alyar666 self-requested a review June 9, 2026 08:20

@Alyar666 Alyar666 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an end-to-end test that covers the actual user scenario.

const hasPreviousCall = lastArgs !== null && cachedResult !== null;
const isArgsSame = hasPreviousCall
? equalByValue(lastArgs, args)
? equalByValue(lastArgs, args, { maxDepth: 5 })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the FILTER_OBJ_COMPARE_DEPTH constant defined in data_controller.ts. I suggest moving it to a more appropriate location (for example, creating a const.ts file inside the data_controller directory) and reusing it wherever needed instead of duplicating the value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, also I'd suggest to refactor the following code also:
if (!equalByValue(prevValue, newValue, { maxDepth: 5 })) {
in the columns_controller.ts

expect(originFn).toHaveBeenCalledTimes(2);
});

it('should call origin fn if args differ on deep value (maxDepth=5)', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test name should call origin fn if args differ on deep value (maxDepth=5) hardcodes the constant value into the description. If the comparison depth is changed in the future, we'll also need to rename the test. It would be better to keep the test name independent of the specific constant value and focus on the behavior being verified.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants