GZGQ.COM
welcome to my space
X
Search:  
 HOME   Statemanager error -- saving the state of body??
Statemanager error -- saving the state of body??
Published by: wktd 2009-01-08
Welcome to:gzgq.com

  • I encountered the strangest error today. Statemanager seems to be saving the state of the body tag. Statemanager applied a left:400, top:600 offset to body!!! WTF???

    I believe one issue may be the fact that Component.stateful defaults to true

    if(this.stateful !== false){
    this.initState(config);
    }

    (stateful is undefined by default)

    I am not sure how to reproduce this error. It is very strange. Any ideas?


  • State manager relies on ids (or stateIds) so it can happen that body tag got same id as was previously saved by the state manager. It is recommended to either use stateIds on components or to turn state management off during development, when generated markup changes a lot, and turn it on before releasing a production version.

    If you want to have it on even during devel, e.g. for testing purposes, do not forget to clear cookies after any major change or when in troubles.


  • If you specifically enable stateful on components you wish to be stateful, and you make sure to give them meaningful state ids, this code will work for you. (I think.. untested)


    Ext.override(Ext.Component, {
    saveState : function(){
    if(Ext.state.Manager && this.stateful !== false){
    var state = this.getState();
    if(this.fireEvent('beforestatesave', this, state) !== false){
    Ext.state.Manager.set(this.stateId this.id, state);
    this.fireEvent('statesave', this, state);
    }
    }
    },

    stateful : false
    JSMF - JavaScript State Management Framework::
    necessary to save and retrieve a particular set of variables. 3) Create the state manager object at body onLoad or as an embedded script.
    http://eric-blue.com/projects/jsmf
    HOME

    });


  • I figured out why I was getting a blank page when a number of cookies were present. It wasn't really the amount of cookies so much as the length of them.

    Apache, by default only allows 8190 bytes (characters) for headers. This includes your cookie data and your GET parameters and all other headers. If you go beyond this amount, Apache will give a 400 Bad Request error.

    I am on Apache Tomcat... and Tomcat just gives you a 200 OK and goes away. No error. It is very confusing at first.

    I have a grid with about 20 columns in it. When the state saves for this grid the cookie is quite large. Between several executions, changing component ids, and the original bug in the post, you end up with several of these large cookies which very quickly takes up that 8k space allowed.

    One can either, not use the Cookie provider, or up the header size limit on Apache.

    For now, however, do not use states!! I cannot stress this enough to developers out there with production systems. Until this bug is fixed, states should not be used unless you give every single one of your components, that save state, a stateId by hand.


  • Another issue with the CookieProvider. Since it stores multiple cookies, rather than a single cookie, firefox can and will die due to too many cookies. Firefox will simply display a blank page. For me, this only happened when the GET or POST request was beyond a certain length as well. I haven't done much emperical testing on this, but clearing cookies was the only thing that resolved the problem. (I restarted, reinstalled firefox, ran in safe mode, disabled all extensions)... cookies was the problem.

    This can happen very quickly in our interface due to the amount of data we have. Here is a screenshot of the cookie list after just 1 minute of interacting with the interface.

    This wouldn't occur if only 1 cookie was used to store state information, or if components did not save their state by default.


  • I have emailed support, Thanks


  • I'm sorry, but we have many reusable components that them selves have nested components. All of which can have several copies on the same page. Uniquely identifying each is not really an option / is cumbersome. Especially considering that this is a fairly massive regression issue.


  • I would like to also note that this problem will happen in 1 page apps. Component ids will easily collide depending on when the components are created. It is very logical that components will be created at different times depending on options a user selects. Coupled with the fact that states are always saved, no matter what, collision is unavoidable... even in a production environment.
  • Tech Logs::
    What is the configuration error you are getting? Please post detail. thanks, Deepak validating the final state of the de-serialized object.
    http://mysite.verizon.net/vzeqjqr0/mytechlogs/2006.02.01_arch.html
    HOME


  • I understand random ids problem.

    The whole reason I've posted it is that you can solve cookies problem with different provider. Nothing less, nothing more.


  • You can also use Session state provider or HttpProvider (http://extjs.com/forum/showthread.php?t=24970).

    Have you taken look?


  • Normally, you should assign ids at least to main components such as Windows, Grids, Trees, etc., or stateIds.

    You can also use Session state provider or HttpProvider (http://extjs.com/forum/showthread.php?t=24970).


  • This doesn't address the core problem. You cannot expect developers to assign component ids to every single component that is ever created. The problem is that:


    You will always get componentId collisions from one page load to another. This cannot be avoided.
    States are always saved, regardless if stateful is set to false


    Because of this, the current implementation of state management is broken and buggy. Ext needs to address these issues. I suggest:


    Disabling stateful by default
    Do not save states for non-stateful components
    Get rid of the stateful argument alltogether in favor of setting stateId which will then activate the statefulness of a component


    Basing anything off of the assumption that component id will always refer to the same component after a page refresh DOES NOT WORK. You cannot base functionality on this assumption!

    ComponentId can only reliably be used to identify components within a single page load; not between multiple page loads... as I have stated many times... as componentId can and often does change for a given component.


  • Well thanks for the HttpProvider recommendation. However it is the intent of this thread to address the bigger issue. We cannot use states at all until the real issue is solved. Is there any traction on this or do we need to develop our own patch to fix this bug in Ext? Do I need to create a new post? How can we get some resolution to this?

    Again, I recommend getting rid of the stateful config option. Only when stateId is provided should a component load / store state. This would solve our problem and prevent others from getting hit by it. Keep in mind this can happen with any size application. I am sure other people are hitting this error and just not realizing it.


  • Also, the stateful value... only affects restoring states. This is a problem as we are getting horrible cookie pollution. If something is not stateful, it should not save state!!! We are still getting collisions when stateful is false on some components and true on others!


  • Yes, but you are missing the bigger point here. Irregardless of the provider you choose you will encounter random component id collisions. Component id cannot be used as a reliable state save key.

    Let me quote myself here .....



    The problem is that:


    You will always get componentId collisions from one page load to another. [edit: component ids will not always refer to the same component across page loads] This cannot be avoided.
    States are always saved, regardless if stateful is set to false


    Because of this, the current implementation of state management is broken and buggy. Ext needs to address these issues. I suggest:


    Disabling stateful by default
    Do not save states for non-stateful components
    Get rid of the stateful config argument alltogether in favor of setting stateId which will then activate the statefulness of a component



    Do you understand what I am trying to say here? This is a serious Ext design flaw in the way states are saved. Sate management is currently unusable in Ext.


  • Ok I understand the problem. However, this seems like something that could happen during production as well. We have a very large app. It seems VERY likely that these auto-generated component ids will collide across the app.

    I think the solution for us is to set Ext.Component.prototype.stateful to false so one must explicitly enable statefulness and force them to provide a stateId as well. Using autogenerated component ids as stateids by default does not work in our application.


  • This would be the decision Jack has to make. You can send him link with this thread or use an other form of Premium support (opening a ticket at support@extjs.com, ...)


  • Perhaps not as large of an issue, but if you are trying to use a cookie state manager you are going to be send massive amounts of data to the server each request as, unless I am mistaken, the browser sends cookie data with every request (including ajax requests). It's already quite a bit when we save only a grid or two, but if every component in the app is saving state information it could get quite overwhelming.

    Not to mention that lots of things like various dialogs are not intended to be state full. I would go so far as to argue that the minority of components require statefullness. Additionally, random IDs are hardly reliable as the order in which they are assigned can change depending on user interaction / application state (each tree node takes up an auto generated slot I believe).

    I guess I don't really see this as an issue with simply testing.





  • Traditional University or MLM University? You Choose
    15 Questions to Ask Your Software Vendor

    You are looking at:gzgq.com's Statemanager error -- saving the state of body??, click gzgq.com to home
  • words like googol
  • industry associations tradeshows for theme related industries see question
  • hiv aids in brazil
  • cutting edge wireless medical devices
  • finding the word game scribbage
  • school uniform debates
  • private question to easterangel
  • property estate agents in london or england that sell international property
  • internet and it security
  • venture capitalism finding the best start up companies in the bay area
  • whatever happened to doris day
  • growth of businesses
  • research on competitive pressures facing the pharmaceuticals biotech industry
  • what is the best email services
  •  
  • commercialism in movies
  • web 2 0 internet futures 10 to 20 most important trends in 5 to 10 years
  • raising a child
  • market research for media with portable people meters
  • marketing associations
  • the top 200 commercial country economies in the world
  • list of puplications with lists of best companies to work for minorities women
  • list clinical research organizations in germany
  • find architectural employee in india to work over internet
  • supply chain visibility
  • for pinkfreud or bobbie7 need brochures from consulting companies
  • easterangel ga
  • business trends in san francisco
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 gzgq.com        Site made:CFZ