• I have just discovered an issue while working on something else...

    If you manage to completely fill up Storage, the next time you reboot, Storage is read as invalid and is automatically erased!

    It's actually surprisingly hard to do that...

    s=require("Storage");s.write("test","Hel­lo",0,s.getFree()-40)
    

    It only happens with values between s.getFree()-32 and s.getFree()-64. Everything else is fine!

    However it's entirely likely that with repeated small writes and frequent resets, you could actually hit this issue.

    Cutting edge builds now have this fixed, as will 2v10 when released!

  • @Gordon thank you for your suggestions and efforts! I tested a lot too. And I have come to the conclusion that sometimes reading and writing to storage is very slow. This is not a problem anyway, but if there is a delayed reboot after that, the memory will be cleared. But it also happens very rarely and I think it has to do with running out of memory.

    This strange code sometimes produced this error:

    function log(f){  
         if (require("Storage").read(f) == "undefined") {
          require("Storage").write(f,'1');
        }else{
          var n=parseInt(require("Storage").read(f))+1­;
          n=n.toString();
          require("Storage").write(f,n);
        }
    }
    
    for (var g=0; g<10; g++) {
    	clearInterval();
    	clearWatch();
    	console.log(require("Storage").getFree()­+'-'+parseInt(require("Storage").read('g­s4.pc'))+1);
    	log('gs4.pc');
    	setTimeout(E.reboot,2000);
    }
    

    Thank you very much!

About

Avatar for Geza @Geza started