PDA

View Full Version : [FIXED]Ext.data.RestProxy URI generation



madrabaz
3 Mar 2011, 1:08 PM
When two or more records was deleted/updated, Ext.data.RestProxy just makes one request to first resource URI.
For example;
We have a three records in a store, [{id:1, name: 'First'}, {id:2, name: 'Second'}, {id:3, name: 'Third'}]
I update record 1 and then update record 2 after that if I sync the store,
a proxy sends a PUT request to http://example.com/MyService/1 (first updated record) and its payload contains [{id:1, name: 'Modified First'}, {id:2, name: 'Modified Second'}].

I think that if the change set length is greater than 1, it must send two seperate PUT requests per record/resource or send the request to http://example.com/MyService/.

OS : Windows 7 Pro SP1
Browser: Chrome 9.0
Ext: 4.0PR2

icflorescu
3 Mar 2011, 4:44 PM
Well spotted!

Can't confirm right now, but this is totally wrong and a dangerous bug:


proxy sends a PUT request to http://example.com/MyService/1 (first updated record) and its payload contains [{id:1, name: 'Modified First'}, {id:2, name: 'Modified Second'}]

Sakuro
9 Mar 2011, 4:22 PM
+1

code from RestProxy.js (PR3)

id = record ? record.getId() : operation.id
chage this to

id = records.lengh > 1 ? undefined : (record ? record.getId() : operation.id)
Will this fix the issue?

evant
14 Mar 2011, 4:15 AM
This should be resolved in the next release.