Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #36954 All Revisions ] Back to Issue ]
Summary 0036954: buildIdentifier function in ob-cache doesn't take into account property names in the criteria
Revision 2017-09-26 13:50 by marvintm
Steps To Reproduce Login in the Web POS. Then, execute the following two queries:

OB.Dal.find(OB.Model.Product, {isGeneric: true}, function(data){console.log(data);})

OB.Dal.find(OB.Model.Product, {bestseller: true}, function(data){console.log(data);})


Verify that they return two different sets of products (makes sense, because the criteria is different).

Now try the following two:

OB.Dal.findUsingCache("productCache", OB.Model.Product, {isGeneric: true}, function(data){console.log(data);})
OB.Dal.findUsingCache("productCache", OB.Model.Product, {bestseller: true}, function(data){console.log(data);})

Both queries are using the same cache (which is something arguably does not make sense), but in any case, they return the same result, which is most likely wrong according to what the developer expected.

If we included the whole criteria in the buildIdentifier function, this would not happen, as two different sets of results would have been created in the cache.
Revision 2017-09-26 13:48 by marvintm
Steps To Reproduce Login in the Web POS. Then, execute the following two queries:

OB.Dal.find(OB.Model.Product, {isGeneric: true}, function(data){console.log(data);})

OB.Dal.find(OB.Model.Product, {bestseller: true}, function(data){console.log(data);})


Verify that they return two different sets of products (makes sense, because the criteria is different).

Now try the following two:

OB.Dal.findUsingCache("productCache", OB.Model.Product, {isGeneric: true}, function(data){console.log(data);})
OB.Dal.findUsingCache("productCache", OB.Model.Product, {bestseller: true}, function(data){console.log(data);})

Both queries are using the same cache (which is something arguably does not make sense), but in any case, they return the same result, which is most likely wrong according to what the developer was expecting.

If we included the whole criteria in the buildIdentifier function, this would not happen, as two different sets of results would have been created in the cache.


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker