Skip to content

Scheduler Render.prototype.refreshDataManager could be invoked before this.parent.activeView is set #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cxspxr opened this issue Feb 16, 2021 · 4 comments
Labels
bug schedule Schedule control

Comments

@cxspxr
Copy link

cxspxr commented Feb 16, 2021

In my project during react scheduler rendering there could be a change in a store from what I feed my scheduler. And by that point on some occasions this.parent.activeView is undefined, thus throwing startDate of undefined. I will open a PR with a if-return, but I guess it's better for you guys to check why activeView could be not set. I can't share my react code here, but I am setting literally currentView="Week" for the scheduler component + isSelected option on ViewDirective and it works well but sometimes the scheduler crashes, when there is refreshDataManager invocation before this.parent.activeView is set on scheduler component first time rendering.

let start: Date = this.parent.activeView.startDate();

@cxspxr cxspxr changed the title Scheduler Render.prototype.refreshDataManager could be invoked before this.parent.activeView is set Scheduler Render.prototype.refreshDataManager could be invoked before this.parent.activeView is set Feb 16, 2021
@ajithr ajithr added the schedule Schedule control label Feb 16, 2021
@Balasubramanian-Sattanathan

Dear customer,

Greetings from Syncfusion Support.

We have checked your reported problem at our end and could reproduce it. So we logged the below bug report. The fix will be included in our weekly patch release scheduled on March 2, 2021 and would appreciate your valuable patience until then. You can track the status by using the below link

https://www.syncfusion.com/feedback/22596/getting-console-error-while-refresh-the-scheduler-datamanager

Regards,
Balasubramanian S

@ajithr ajithr added the bug label Feb 22, 2021
@cxspxr
Copy link
Author

cxspxr commented Mar 4, 2021

@ajithr the issue still persist, because refreshDataManager is not only invoked from Renderer.render but also e.g. from ScheduleComponent.Schedule.propertyChangeAction and possibly in other places. I guess it is better to move activeView check directly to the refreshDataManager. I made a PR #102

renderer.js:164 Uncaught (in promise) TypeError: Cannot read property 'startDate' of undefined
    at Render.refreshDataManager (renderer.js:164)
    at ScheduleComponent.Schedule.propertyChangeAction (schedule.js:1492)
    at ScheduleComponent.Schedule.onPropertyChanged (schedule.js:1472)
    at ScheduleComponent.Base.dataBind (base.js:132)
    at ScheduleComponent.Component.dataBind (component.js:269)
    at ScheduleComponent.Base.setProperties (base.js:72)
    at ScheduleComponent.ComponentBase.refreshProperties (component-base.js:160)
    at ScheduleComponent.ComponentBase.updateProperties (component-base.js:149)
    at ScheduleComponent.ComponentBase.shouldComponentUpdate (component-base.js:101)
    at checkShouldComponentUpdate (react-dom.development.js:12730)

@maheshtps
Copy link

Hi Everyone,

We are glad to announce that our weekly release in version 18.4.48 has been rolled out successfully. In that release, we have fixed the reported issue. So, we suggest you upgrade our Syncfusion packages to avail of the fix on your end.

Release notes:
https://ej2.syncfusion.com/react/documentation/release-notes/18.4.48/?type=all#schedule

Could you please check and get back to us, if you need any further assistance on this.

Regards,
Mahesh

@rajendranr-5483
Copy link
Collaborator

We are closing this issue since there is no recent activity. Feel free to reopen the issue and update your comments for the reinvestigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug schedule Schedule control
Projects
None yet
Development

No branches or pull requests

5 participants