Opened 8 years ago

Closed 8 years ago

#13564 closed defect (fixed)

dojo.data.ItemFileWriteStore identity problems

Reported by: Deirdre Hall Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.7
Component: Data Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

We have a multi-user web application in which items are pushed out to user sessions over a dwr type interface, and fed into an ItemFileWriteStore? for use in display grids.

Items may be pushed out at any time during a user's session, and while there are guarantees their ids will be unique, there is no guarantee that those unique ids will be received in order.

Every time a new item is received, we do a store.fetchItemByIdentity({identity:id, onItem(item){}); Our datastore is defined with an identity and all our objects contain that identity.

This was originally written for dojo 1.3. If the identifier was not found, the item was null in onItem and a new item needed to be created. If the identifier was not null, an item existed and needed to be updated.

With dojo 1.6, IF the explicit identifier does not exist, but the number of items in the store is higher than the identifier, the fetchItemByIdentity returns the item with the internal identifier (_0) equal to the explicit identifier. For example, if 13, 14, and 15 exist in the store and it receives an item with identifier 2, it returns item 15 (the item at slot 2 in a 0-based array).

In the attached test, you can switch between 1.5.1 and 1.6 to see the difference in response.

Attachments (1)

test.html (2.4 KB) - added by Deirdre Hall 8 years ago.
test file demonstrating issue

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Deirdre Hall

Attachment: test.html added

test file demonstrating issue

comment:1 Changed 8 years ago by Jared Jurkiewicz

That seems a bit bizarre. I'm not aware of *any* changes that went into IFS regarding fetch/load of identities since 1.4

comment:2 in reply to:  1 Changed 8 years ago by Deirdre Hall

Replying to jaredj:

That seems a bit bizarre. I'm not aware of *any* changes that went into IFS regarding fetch/load of identities since 1.4

That was why I wrote up the test case separate from our system (which can be a pretty complex mess to unscramble at times). I've been running down the issue of "vanishing" items for about 8 hours now, and wanted to make sure the issue was dojo, not our system itself.

comment:3 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

In [26193]:

Fixing issue with additional check actually breaking identity lookup. Not sure who added the check, but it was wrong. \!strict fixes #13564

comment:4 Changed 8 years ago by Jared Jurkiewicz

Milestone: tbd1.7

comment:5 in reply to:  3 Changed 8 years ago by ben hockey

Replying to jaredj:

In [26193]:

Fixing issue with additional check actually breaking identity lookup. Not sure who added the check, but it was wrong. \!strict fixes #13564

it was added by you in r22784 from a patch on #11624.

comment:6 Changed 8 years ago by bill

Resolution: fixed
Status: closedreopened

Sounds like it needs another look, like it re-broke #11624.

comment:7 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: reopenedclosed

Fixed in: [26230]

Note: See TracTickets for help on using tickets.