Closed jagged3dge closed 6 years ago
Wrap the first persistor.load
in a try catch?
I did some digging and found that this is somehow being caused by an extra ending brace }
at the end of the JSON string of the serialized state. Since this is probably an issue with the serialization library I'm using, I think we can safely close this issue.
Thank you for the interest :+1:
I did some digging and found that this is somehow being caused by an extra ending brace
}
at the end of the JSON string of the serialized state. Since this is probably an issue with the serialization library I'm using, I think we can safely close this issue.
@jagged3dge I am having the very same issue: have you been able to pinpoint the bug? Which serialization library are you using?
@nullp01nt3r I'm using json_serializable package for serialization.
I couldn't, however, pinpoint which part of the state is causing the extra brace after being serialized. So, I had to resort to monkey-patching a personal fork of the json_serializable to handle the case, limited to this project.
I haven't been able to reproduce this issue on another project I've been working on, so, it's something quite relative to the object structure, it seems.
it's something quite relative to the object structure, it seems.
@jagged3dge as a second tought, I do not believe it's serialization fault: if you want, have a look at:
Hi! Thank you for this fantastic package! Unfortunately, I get thrown
SerializationException: Load: FormatException: Unexpected character
on app restart. Seems there could be some issue when serializing/saving the state via the proxy wrapper (toJsonWrapper
) method, as described in #10I could attempt to investigate and fix that, if I could only clear the currently stored data from the storage. Is there a way I could force-clear the saved data via the
FlutterStorage
instance, while developing?This is my AppState:
I'm declaring the
persistor
instance like so:Relevant error log in VS Code debug console: