# possible fuse storage regression on device

**URL:** https://forums.fusetools.com/t/possible-fuse-storage-regression-on-device/5425
**Category:** Bug Reports
**Created:** [May 16, 2017, 10:08am UTC](https://forums.fusetools.com/t/possible-fuse-storage-regression-on-device/5425 "2017-05-16T10:08:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://forums.fusetools.com/u/prince)
#### Post date: [May 16, 2017, 10:08am UTC](https://forums.fusetools.com/t/possible-fuse-storage-regression-on-device/5425/1 "2017-05-16T10:08:08Z")

</div>

i’m saving the value of my token in the local storage , and try the perform some task using it, it perfectly works on local preview preview, but fail on device for both iOS and android.

my saving and load function is specified in a separed file in my lib folder

```auto
var Storage = require("FuseJS/Storage");

// save storage 
function saveStorage(savedata, json){
  return new Promise(function(resolve, reject) {
    Storage.write(savedata, json).then(function(results){
      resolve(results)
    })
  });
}

// load function
function loadFromStorage(data){
  return new Promise(function(resolve, reject) {
    Storage.read(data).then(function(results){
      resolve(results)
    })
  });
}

```

this is how i try to load into my main view , to see if in the storage i have a token

```auto
var storage = require("lib/storage")

 function loadToken(){
  storage.loadFromStorage("AuthToken").then(function(results){
    if(!results){
      router.goto("Walkthrough")
    }else{
      router.goto("Home")
    }
  })
}

```

it works perfectly in local preview , but for both iOS and android it fail

`Fuse version: 0.37`  
`MacOS`

---

<div class="post-metadata">

### Author: ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)
#### Post date: [May 16, 2017, 10:27am UTC](https://forums.fusetools.com/t/possible-fuse-storage-regression-on-device/5425/2 "2017-05-16T10:27:49Z")

</div>

Exactly how does it “fail”?

Is there an error message of any kind when you run the previews?

Have you added `console.log()` statements somewhere to try and figure out if/when data gets written or read?

Any other important details that you could share?

Related: you should consider using [FileSystem module](https://www.fusetools.com/docs/fuse/filesystem/filesystemmodule) instead of `Storage`.
