Destroy persistent data from datastore
A realtimeview has a Destroy When Last Client Leaves flag, but if i turn it off (so it persists) when enabling it back, the model is still persisting on disk.
In order to resolve this, i resetted the View UUID, i got a new RealtimeView with a different datastore, but the old one seems to persist on each session.
3 Replies
Hi @Andrei Vaduva. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The "Destroy When Last Client Leaves" flag in RealtimeView is used to specify whether to destroy this RealtimeView when the last client leaves. If you leave this unchecked, all views and components, and their models, will persist between sessions. If you want to clear the view and its models from the datastore when the last client leaves, you should check this option. It will then be recreated by the first client to join in a new session source (https://normcore.io/documentation/realtime/realtimeview#ownership--lifetime-flags).
Resetting the View UUID will not delete the persistent data. It will only create a new RealtimeView with a different datastore. Once reset, this view will not be able to communicate with scene views that had the old ID. It will also not be able to retrieve persistent data stored under the previous Scene View UUID source (https://normcore.io/documentation/realtime/realtimeview#reset-view-uuid).
If you want to delete a model from a RealtimeSet, you should be careful when multiple clients attempt to delete the same model at the same time. In order to prevent this, it is generally recommended to have the client that owns the object destroy it. Here is an example of how to do it:
source (https://normcore.io/documentation/room/common-questions#im-getting-the-error-server-attempted-to-delete-value-from-set-for-key-that-doesnt-exist-in-storage-this-is-a-bug-how-do-i-fix-this)
If you're still having trouble, you might want to check the ownership settings of your RealtimeView. Every RealtimeView has an ownership and permissions model that’s enforced by the server. If this view is owned by a particular client, other clients will be unable to change any permissions on the view, its components, or its child views and their components source (https://normcore.io/documentation/realtime/realtimeview#ownership).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1217086475661738045> kapa.ai is still learning and improving, please let us know how it did by reacting below
you have to call Realtime.Destroy on it or change the room name or change the app key