I keep getting this error in my app but have no idea what is causing it.
It happens whenever I commit my data store:
Attempted to handle event loadedData
on while in state rootState.loaded.updated.inFlight. Called with undefined
Anyone?
Here is the code that causes it:
var ts_setting;
ts_setting = Cluey.Setting.find(Cluey.SettingsKeyIDs.API_TIMESTAMP);
if (ts_setting.get('value') != null) {
console.log("Found Timestamp");
} else {
console.log("Creating Initial Timestamp...");
ts_setting.set("id", Cluey.SettingsKeyIDs.API_TIMESTAMP);
ts_setting.set("value", 0);
Cluey.store.commit();
}
Edit
I have boiled it down to the following code (written in coffeescript) that is causing the error. The thing is, that the first time I run the code, when the object first does not exist in the data store, it runs fine. The error then happens when I run the code on a data store that already contains a record with the specified id. This might help you decipher what is happening.
ts_setting = Cluey.Setting.find(Cluey.SettingsKeyIDs.API_TIMESTAMP)
ts_setting.get('value')
ts_setting.set("id", Cluey.SettingsKeyIDs.API_TIMESTAMP)
ts_setting.set("value", 0)
Cluey.store.commit()
Edit 2
I am having a similar problem creating a record:
ts_setting = Cluey.Setting.createRecord
id: Cluey.SettingsKeyIDs.API_TIMESTAMP,
value: 0
Cluey.store.commit()
The above code gives me this error:
Uncaught Error: Attempted to handle event `loadedData` on <Cluey.Setting:ember327:1> while in state rootState.loaded.created.inFlight. Called with undefined
Edit 3
So it turns out I was calling @timestamp = ts_setting.get('value')
just after committing the store which I suppose was causing the issue, as I was trying to fetch some data from an object that had not yet been saved.