You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I upgraded from v2.1.0 to v2.1.2 and noticed that Model.find() returned cached entries from a previous fetch that had different conditions. I also tried the current master version.
I am using sqlite3 3.7.15.2-1ubuntu1 with node-sqlite v2.1.17.
git bisect gave me that 9141d43 is the faulting commit.
Test case:
var orm = require("orm");
var Logs;
orm.connect("sqlite:///tmp/orm_cache.sqlite?debug=true", function (err, db) {
Logs = db.define(
"log", {
"date": Date,
"log": String
});
db.sync(function() {
Logs.create([
{date: new Date(), log: "test1"},
{date: new Date(), log: "test2"},
], function(err, data) {
getLog(1, "getLog 1 after insert");
});
});
});
function getLog(id, output) {
//Logs.find({id: id},{cache: false}).only(["log"]).run(function(err, data){
//Logs.find({id: id}).run(function(err, data){
Logs.find({id: id}).only(["log"]).run(function(err, data){
console.log(output + ": " + data[0].log);
});
};
setTimeout(function() {getLog(2, "getLog 2 after 1 second");}, 1000);
expected output:
getLog 1 after insert: test1
getLog 2 after 1 second: test2
actual output:
getLog 1 after insert: test1
getLog 2 after 1 second: test1
With {cache: false} or without only I get the expected output.
The text was updated successfully, but these errors were encountered:
Today I upgraded from v2.1.0 to v2.1.2 and noticed that Model.find() returned cached entries from a previous fetch that had different conditions. I also tried the current master version.
I am using sqlite3 3.7.15.2-1ubuntu1 with node-sqlite v2.1.17.
git bisect gave me that 9141d43 is the faulting commit.
Test case:
expected output:
actual output:
With {cache: false} or without
only
I get the expected output.The text was updated successfully, but these errors were encountered: