Hi,the api "actionhistoryforuser" is wrong. The query easyrec executed is
"SELECT tenantId, itemId, itemTypeId FROM action WHERE tenantId=? AND userId=? AND actionTypeId=? GROUP BY itemId LIMIT ?"
In this query is missing the order clause (order by actionTime desc)
Davide
Anonymous
Hi Davide!
I've checked the source code and even traced a complete API call with a debugger and the order by clause is definitely there and being executed!
Can you give more details about how you came to this conclusion (easyrec version, api call parameters,...)? Did you use a DB monitoring tool?
I guess you had some issues that led you to investigating, so what was the actual issue you had (e.g. unexpexted items in result,...)? Maybe there is another explanation.
So if you provide further details we are happy to help. Otherwise I'm going to close this ticket since we cannot reproduce the problem.
Greetings Stephan
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Hi Steve, I've deployed easyrec-0.99, and I've integrated it with my application. I started to use easyrec's api in the last months and I've noticed that after some days "actionhistoryuser" api stopped to send me the last items viewed by my user (easyrec always sent me the same items). So, I downloaded easyrec source code from github ( here http://sourceforge.net/p/easyrec/code/ci/master/tree/ ) and I've start to debug Easyrec. I've fixed the class "ActionDAOMySqlImpl.java"
(method "getItemsByUserActionAndType" http://sourceforge.net/p/easyrec/code/ci/master/tree/easyrec-core/src/main/java/org/easyrec/store/dao/core/impl/ActionDAOMysqlImpl.java)adding the order clause condition.
I don't know if I cloned the wrong repository but I've found this error. I've fixed it and everything start to work correctly.
Probably I have a wrong version of easyrec, I don't know.
Thank you for your support!
Davide
Thank you for the more detailed explanation. Given your links I could see that you are using the master branch. And you are right, in the master branch the issue you describe exists.
It has long been fixed on the develop branch, that's why I couldn't find the error!
Greetings Stephan