Pipelining code - possible bug?

Pipelining code - possible bug?

DaveBurnsDaveBurns Posts: 17Questions: 0Answers: 0
edited December 2011 in General
Allan -

I'm using 1.8.2 with server-side processing and Firefox 8.0.1. I'm seeing some strange behavior from the pipelining code I got from http://datatables.net/examples/server_side/pipeline.html and I'm wondering if this is known.

When I load the first page of rows, the pipelining code loads the first 5 pages of rows - great. When I go to page 2, it then loads pages 2-6 - not expected. If I then go to page 3 and so on the paging is instant as expected. If instead I go back to page 1, it loads page 1-5 again and then moving from page 1-5 is instant as expected. It seems like there's some strange initialization bug that gets resolved after one or two hits to the server.

I have this on my list of things to debug but wanted to check with you to see if anyone had already seen it and looked into it.

db

Replies

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Hi,

    I've just tried the example page with Firefox 8.0.1 Mac and I'm afraid I'm not able to reproduce the problem. It fires one XHR to the server to load 50 rows, then doesn't fire another one while paging until I get past those 50 rows.

    I've not come across this issue before, and I'm afraid I'm not sure how much help I'll be able to offer unless I can reproduce it. Are you getting any errors on the console as well? Does Chrome also have that problem for you?

    Allan
  • DaveBurnsDaveBurns Posts: 17Questions: 0Answers: 0
    Allan -

    I finally spent time with FireBug and the bug was mine but it's worth pointing out this potential issue in your doc for the pipelining code for other users' benefit. In your pipelining code, you have a check to see if any of the parameters passed to the server have changed and, if so, you invalidate the cache. I also use the fnServerParams option to inject my own fields into the parameters sent to the server and these were triggering your check since they were not initialized properly in my code (first call they were null, after that they were '').

    You do have a special case in your code to skip checking a few fields and I could have brute-forced it by adding my own field names but that's ugly unless you build a general purpose mechanism to let the pipelining code know about which fields to ignore (not hard to do but I want my code to match the official version as much as possible).

    Cheers,
    db
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Cool - thanks for investigating further and letting us know your findings! Indeed the cache invalidation can be a little bit tricky. What I will do at some point is look at "upgrading" the server pipeline code from a simple demo to a proper plug-in for DataTables that will take all passed in parameters into account. Added to the to-do list :-)

    Allan
This discussion has been closed.