When I tried to use post with datatable, it will send endless data request to server, it seems a serious bug.
Steps to re-produce it:
Open below sample, it’s cloned from an online sample, and changed some properties like size, datafetch, url (post->): https://snippet.webix.com/8lp2ez6r
Click any page > 1, like Page 2, Page 7, etc
You will see endless (dead loop) data request sent to server
It’s tested in latest Google Chrome.
It seems GET method is working ok.
After carefully tracing and comparing the data items, I finally found a mistake at server side script, which could lead to duplicated items fetched (comparing to already loaded items in datatable of client side).
So the endless data request was caused by data items fetched are already existed in client side. The problem was resolved after server side script fixed.
After review the case, I suggest to add some checking to datatable, so the endless data request might be avoided, I think datatable shouldn’t be breaked by mistake of data.
For example:
When loading is in progress, and a new load request with same start (and count?) triggered, the new load request shouldn’t be queued (in _feed function?), and user need to be warned in debug version
If server return unwanted data (pos<>start?), should stop requesting and warn user
If server return items which are duplicated (all existed in client side or start
item duplicated), should stop requesting and warn user
Just for your information, I have met two cases of datatable dead loop requests:
case 1:
server paging
column id existed
server return duplicated id when paging (normally happens when no sorting by id)
if datatable cannot get required records, it will just repeatly to requst until browser hang
case 2:
server paging
column id existed
external filter registered, but not applied on changed
using proxy in url
datatable will request first set of data at initial (for example total records = 1000 )
input value into the external filter (not applied, but will limit total records, for example new total records = 5 )
click page 2->3->4, once datatable starts to request data, it will repeatly to request until browser hang
the reason is new filter applied and total records changed, however client side total records not changed, datatable just repeatly request non-existing page
in the requests, “continue” is always true, it seems the filter change is not checked for new server request