Closed prmr closed 10 years ago
I ran the application on two different tabs and searched 'Toaster' and 'Humidifier'. It was working fine, but after checking a couple of features on each and clicking submit on first the 'Toaster' tab and second on the 'Humidifier' tab the 'Humidifier' tab products changed to the 'Toaster' search ones. This was on Chrome.
This now appears to be fixed by the new SiteController
in branch 75, but I'll test some more before closing.
The application seems to freeze (no sorting) during concurrent access.
@priyasidhaye can you merge the SiteController ASAP?
Hey @ceipher -- I want to put a problem that I noticed on your radar. I think that this would be addressed by the solution to this issue. I'll describe it as a test-case:
In fact this delay is not due to waiting for an ajax request, it's due to a script grabbing all the browser's resources. This must be the re-sorting script doing an order n^2 matching. The fact that there are so many toasters is what kills us.
I think it will get fixed with the changes we discussed, which prevents the need for client-side matching. So this is just a test-case to be aware of!
Hi, yes I will merge master into SiteController now.
On Fri, Apr 4, 2014 at 4:04 PM, enewe101 notifications@github.com wrote:
TODO - handle null search case for categories
Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/81#issuecomment-39605603 .
I don't think the delay is caused by ranking and sorting the products. Both of those things happen in the ProductRanker class. I added a debug log at the beginning and the end of the ranking method, and both of the logs appear almost immediately (and simultaneously) in the console. But even when the console indicates the ranking/sorting is done, the website's list is only updated 1-2 seconds later.
@forgues -- yup you're right, not because of server-side rank/sort, I meant on the client side...
In order to deal with thymeleaf binding problems, the client executes a javascript that takes the sorted result from the server and then compares it to the DOM, and figures out which products that already exist on the page match which products in the new ordering, then shuffles them around into new spots. So it's a lot of jQuery juggling, which can get expensive.
When I was fixing the problem ,I noticed more and more places where we saved the dangerous important value in the server, such as aScoredAttr. So that it is not even a session issue, but the sever holds the categoryId for every client
As a result, we should not set ANY variable in the SiteController or Facade. Only service object is allowed.
The problem has been fixed and merged in master. @enewe101 after a few code cleans, I will close this issue.
Done
Looks great! This seems to alleviate the issues with updating features in categories that have lots of products (e.g. the side-by-side refrigerator). It will be even better when we limit number of products returned by the server.
I can see you have to re-create the spinner elements after clearing the products div and loading new products -- does that take care of the issue @priyasidhaye posted on #87?
cannot reproduce the #87 issue either on firefox, I think it should solve that
Steps to reproduce: In a browser (I tested with Firefox 27.0):