[Sponge] Modifying SubjectData doesn't change the Transient SubjectData
SometimesMage opened this issue ยท 1 comments
Currently, right now with Sponge API 4.0.3 and PEX build 117 when you want to modify a Subject
's permissions and parents, and have this modification to persist and show up in-game you have to get both the persisted SubjectData
(link) and the transient SubjectData
(link). Now I would think if you want a change to a Subject's data to persist you would also want that change to show up in-game as well. However, like I said this is not that case and I would have to modify two SubjectData
s. I was hoping to get some insight on the reasons for this or to point out a bug.
Both transient and persistent data objects apply in-game. The difference is that persistent data is stored to a file, while transient data is stored only in memory. This means that modifications to persistent data will not show up in transient data (and vice versa), but both will apply in-game.
The only time things might not align perfectly is when updating data -- PermissionsEx updates data asynchronously (and exposes all set operations as CompletableFutures internally), but Sponge's api only exposes immediate return values, so immediately after setting a permission caches may not be cleared. Each Sponge SubjectData object will update its internal ImmutableSubjectData immediately though, so executing multiple changes at once will not overwrite if saving is not complete.