I´m building sort of a shop using Noodl. In it i have two different devices, one showing the shopping interface and the other showing the backend with placed orders and so on.
When an order is created an Order item, a model, is created containing info about the order and also a Collection containing all the order items, which are models with their own parameters.
The collection containing order items, and the order items, is created in a js node which sets unique ids to both order items and the collection containing them. The collection is then added to the order which is then added to the order list.
Then at the backend I´m listing all the orders and you can click on them to show their info and their order items from the collection.
So my problem. When I´m running everything locally through Noodl on my computer the orders show up just fine on the backend I can click on them and show the order items of a order. But when showing the shopping interface and placing an order from a separate device the collection containing the order items get lost, or doesn´t get transferred to the other device. I know this because I run Noodl.Collection.exists(“xxx”) in the console in both cases.
I also get this error message when trying to display the information about an order in the backend, when it doesn´t work.
Maybe also worth mentioning is that if I start by adding some orders while running all interfaces on the same device they work, but as soon as an order is added from another device all orders stop working even though I can see that the locally created order item collections still exist.
I guess that this must be a persistance issue and that when I create the collection with order items and the models for the order items they get none or local persistence and hence aren´t available to the other device when running several devices.
So my question is how do I solve this, can I set persistance to global via js or is there some other solution I can use to solve this problem?
Hoping someone out there can help me because this is driving me crazy.