-
1 Dec 2011 7:40 AM #1
Direct transactions not cleaned up
Direct transactions not cleaned up
REQUIRED INFORMATION
Ext version tested:- Ext 4.0.7
Browser versions tested against:- Firefox 7.0.1 (FireBug 1.8.3 installed)
DOCTYPE tested against:- <|DOCTYPE html>
Description:
I have a problem where Ext.Direct.transactions is retaining information about every call, and so the memory is never free'd. In the case of a form the transaction entry contains a reference to that form, so this is even more memory that hangs around.
Steps to reproduce the problem:- Use the console to show the value for Ext.Direct.transactions.length, which should be 0.
- Issue an Ext Direct call and wait for the callback to complete so show the result has been processed.
- Use the console to show the value for Ext.Direct.transactions.length, which will now be 1.
The result that was expected:
The transaction entry should be removed from Ext.Direct.transactions after the response has been handled.
The result that occurs instead:
Ext.Direct.transactions retains an entry for the transaction.
Test Case:
Not provided as it requires server-side code. I find this happens with any Ext Direct transaction.
HELPFUL INFORMATION
Screenshot or Video:
None
Debugging already done:
The onData() method of RemotingProvider calls Ext.direct.Manager.removeTransaction() on line 298. This in turn calls getTransaction(), which checks for an isTransaction property on the transaction object. Since there isn't one it performs another look-up which fails and returns undefined. If I call Ext.direct.Manager.removeTransaction() using the original value for the transaction object that's passed into removeTransaction() then the item appears to be removed as expected. I can't find the isTransaction property referred to anywhere else in the framework.
In the forum I was asked: "Looking at line 293 of RemotingProvider.js where the line is right before the getTransaction... what is the event?"
My response: "It's an instance of Ext.direct.RemotingEvent, where the action and method properties match the direct function I called. The type property is "rpc" and the status property is true."
Possible fix:
This was suggested as a work around in the forum and it works for me.
Code:Ext.direct.Manager.getTransaction = function(transaction){ return transaction.isTransaction || Ext.isObject(transaction) ? transaction : this.transactions.get(transaction); };
Additional CSS used:- default ext-all.css
- some icons used on trees and tabs
- an override for x-fieldset-header-text
Operating System:- WinXP Pro 64-bit
-
1 Dec 2011 8:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
Thank you for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-4626
in
TBD.


Reply With Quote