Declined
Last Updated: 12 Dec 2022 13:14 by ADMIN
Paul
Created on: 28 Nov 2022 19:01
Category: Kendo UI for jQuery
Type: Bug Report
0
Client read event not firing, or perhaps firing out of order on scheduler

I have some client events for creating/updating events.

They are currently the same and call the same method:

Due to JSON serialization, I end up with dates being serialized as ticks when sent to the client. This function converts these ticks to a proper JavaScript Date() object. The code works perfectly fine.

We run into an error on random occasions. This happens maybe once a day per user. It is not repeatable but it was fixable. This code is from the Kendo.all.js file. The highlighted lines were added:

99% of the time things work fine. But sometimes this convertData() method is called before the client methods are called. Perhaps a threading or AJAX or promise issue?  Perhaps there is one scenario where the client method is not being called? The real bug here is that convertData() can sometimes get called before the client’s event where I would have corrected by dates. This is another case where it is tough to upgrade Kendo versions because I need to port this as minified JavaScript to the custom downloaded minified file.

Here is the text from the browser’s F12 window when we hit this error (If I have not applied the fix above):

kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1 Uncaught TypeError: f.start.getTimezoneOffset is not a function
    at ai (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:1182628)
    at init.data (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:1182352)
    at init._readData (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:96753)
    at init._push (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:90345)
    at init._pushUpdate (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:90237)
    at init.e (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:95021)
    at init.a (signalr?v=4OffKgJP3BKl-a0HMCu8SoFYj-iqmWy-1sbyLwYhtvk1:1:36810)
    at init.dispatch (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:55579)
    at y.handle (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:53581)
    at Object.trigger (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:78599)

3 comments
ADMIN
Veselin Tsvetanov
Posted on: 12 Dec 2022 13:14

Hello Paul,

Thank you for the follow-up.

In case you identify a reliable pattern to reproduce the problem in question, please, do let me know. Otherwise it would be difficult to guess any reason for the issue in question.

Regards,
Veselin Tsvetanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Paul
Posted on: 05 Dec 2022 19:56

I added a client read() method and set it to update the dates from ticks to date objects. But the read() method is never executed. A "debugger" line in there does not hit.

The code I added to the kendo.all.js file that adjusts these dates was only needed for one user so the issue is not repeatable and is intermittant even for them. Which is why I wondered if it were some type of threading issue. I'll leave the read even in place but I still need to leave the kendo modification in place as well since I don't have an explanation for why it occurs sometimes.

C#:

JS:

ADMIN
Veselin Tsvetanov
Posted on: 05 Dec 2022 15:29

Hello Paul,

As far as I can see from the applied change to the source code, it initializes Date objects, because the values present in the event.start and event.end fields are numbers (and not Dates as expected). Having that said, I would recommend you to double check the hub.client implementation and make sure dates are properly converted for all actions (not only for Create and Update, but also for Read, and if any events data is present there, for the Destroy too).

Regards,
Veselin Tsvetanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.