Opened 9 years ago

Closed 9 years ago

#15928 closed defect (invalid)

[regression] dojo/store/Observable.observe broken in 1.8.0

Reported by: lauri.kimmel Owned by: Kris Zyp
Priority: undecided Milestone: 1.8.1
Component: Data Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:


new Observable(...).query().observe() is not working any more as it was in 1.7.x releases.

Complete example

require(["dojo/store/Memory", "dojo/store/Observable"],
    function(Memory, Observable){
        var employees = [
            {name:"Jim", department:"accounting"},
            {name:"Bill", department:"engineering"},
            {name:"Mike", department:"sales"},
            {name:"John", department:"sales"}
        var employeeStore = new Memory({data:employees, idProperty: "name"});
        var obs = new Observable(employeeStore);
        obs.query().observe(function(obj, from, to) {
            alert("New employee: " +;
        }, true);
        employeeStore.put({ name: "Broken in 1.8.0", department: "test"});

Change History (3)

comment:1 Changed 9 years ago by lauri.kimmel

Ignore previous jsfiddle link - it's broken.

Correct version

comment:2 Changed 9 years ago by bill

Component: Storage/FlashData
Milestone: tbd1.8.1
Owner: changed from Shane O'Sullivan to Kris Zyp
Summary: dojo/store/Observable.observe broken in 1.8.0[regression] dojo/store/Observable.observe broken in 1.8.0

comment:3 Changed 9 years ago by Colin Snover

Resolution: invalid
Status: newclosed

Thanks for the report, but this is not a Dojo bug.

In Dojo 1.7, Observable did not correctly create and return a new object but actually altered the original store. In Dojo 1.8, it properly creates a new object. You are putting to the non-Observable store. If you change the last line from employeeStore.put to obs.put it will work correctly.

Note: See TracTickets for help on using tickets.