Skip to content

Conversation

@Ambrozy
Copy link
Contributor

@Ambrozy Ambrozy commented May 16, 2025

No description provided.

@Ambrozy Ambrozy self-assigned this May 16, 2025
@Ambrozy Ambrozy added the 25_1 label May 16, 2025
@Ambrozy Ambrozy force-pushed the 25_1_resources_refactor branch 3 times, most recently from 41c109c to 78ad7d1 Compare May 22, 2025 21:02
@Ambrozy Ambrozy marked this pull request as ready for review May 26, 2025 08:09
@Ambrozy Ambrozy requested a review from a team as a code owner May 26, 2025 08:09
@Ambrozy Ambrozy force-pushed the 25_1_resources_refactor branch 2 times, most recently from 3b37719 to fe2da5c Compare May 26, 2025 11:57
@Ambrozy Ambrozy force-pushed the 25_1_resources_refactor branch from fe2da5c to f893ad9 Compare May 27, 2025 06:59
@wdevfx
Copy link
Contributor

wdevfx commented May 27, 2025

The OnContentReady behavior changed when we have a local resource data source
Previously, because the local resources data source load was sync -> on the OnContentReady hook resources was already applied

Now it always work like remote data source (see attached video)
Let's try to wait the resources initial loading (if exists) before firing the OnContentReady event

Screen.Recording.2568-05-27.at.10.36.59.mov

wdevfx
wdevfx previously approved these changes May 27, 2025
@wdevfx wdevfx dismissed their stale review May 27, 2025 10:08

Clicked wrong button while pushing comments, sorry :)

@wdevfx
Copy link
Contributor

wdevfx commented May 27, 2025

Unfortunately, found the broken case
If Scheduler has groups, and we change the resources option synchronously after component creation -> appointments will not be loaded

Configuration:

const resourceA = {
  fieldExpr: 'resourceId',
  dataSource: [{
    text: 'A',
    id: 1,
    color: '#1e90ff',
  }],
};
const resourceB = {
  fieldExpr: 'resourceId',
  dataSource: [{
    text: 'B',
    id: 1,
    color: '#f00',
  }],
};
 const appointment = {
  startDate: '2024-01-01T01:00:00',
  endDate: '2024-01-01T02:00:00',
  text: 'Test appt',
  resourceId: 1,
}

const scheduler = $('#scheduler').dxScheduler({
  dataSource: [appointment],
  views: [{
    type: 'workWeek',
    name: 'TestView',
  }],
  currentView: 'TestView',
  currentDate: '2024-01-01',
  groups: ['resourceId'],
  resources: [resourceA],
}).dxScheduler('instance');

// Change resources synchronously
scheduler.option('resources', [resourceB]);

In the previous `24.2``` version, this case works well (but with a remote DataSource, we will receive the internal error in both versions)

I checked other similar cases (like similar runtime groups change, change resources without groups and etc.),
Looks like other cases works similarly

@Ambrozy Ambrozy force-pushed the 25_1_resources_refactor branch 2 times, most recently from 97ed529 to 21c8221 Compare June 2, 2025 12:26
@Ambrozy Ambrozy force-pushed the 25_1_resources_refactor branch from 53e7d14 to cb308f4 Compare June 3, 2025 06:27
@@ -0,0 +1,27 @@
export const waitAsync = (timeout = 0, clock = undefined) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

[🚨 Important]

Discussed and decided to get rid of this waitAsync in terms of a separate tech task

It's better to use the sinon.fakeTimers instead of the real marco tasks

@Ambrozy Ambrozy merged commit 63b973e into DevExpress:25_1 Jun 3, 2025
363 of 365 checks passed
@Ambrozy Ambrozy deleted the 25_1_resources_refactor branch June 3, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants