Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5201 closed defect (fixed)

QueryReadStore: lastServerQuery object references serverQuery

Reported by: guest Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.0.2
Component: DojoX Data Version: 1.0
Keywords: Cc: juho.manninen@…
Blocked By: Blocking:

Description

Object reference in QueryReadStore? can result to unexpected behavior. When store is queried for the first time, a reference to query object is stored:

this._lastServerQuery = serverQuery;

When querying the store for the second time with altered (not new) serverQuery object, no xhr-request is made, because they both point to the same object:

dojo.toJson(serverQuery)==dojo.toJson(this._lastServerQuery)

Storing a clone instead of a reference into lastServerQuery would fix this. So, how about mixing the serverQuery object into a new object?

Attachments (1)

dojox.data_QueryReadStore_serverQuery.patch (537 bytes) - added by Jared Jurkiewicz 12 years ago.
Quick use of mixin to cllone a query

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by Jared Jurkiewicz

Will look at the suggestion next week (after Thanksgiving stuff, lots of relatives to deal with this week). Should be a trivial update.

comment:2 Changed 12 years ago by Jared Jurkiewicz

This seems a reasonable (and trivial) request to make. Cloning the query object via mixin is easy enough to do. Patch forcoming.

Changed 12 years ago by Jared Jurkiewicz

Quick use of mixin to cllone a query

comment:3 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [11635]) Patch for cloning sever query object to avoid reference issues. Fixes #5201

comment:4 Changed 12 years ago by Jared Jurkiewicz

(In [11636]) Porting 1.0.2 patch into trunk. refs #5201

Note: See TracTickets for help on using tickets.