MadStudioRoblox / ProfileService

Universal session-locked savable table API
https://madstudioroblox.github.io/ProfileService/
Apache License 2.0
292 stars 157 forks source link

Yield before releasing all profiles in OnClose #19

Closed lucasmz-dev closed 2 years ago

lucasmz-dev commented 2 years ago

Fixes issue mentioned here.

Do some testing just to be sure 👍🏻

LM-loleris commented 2 years ago

A guarantee time window for accessing profiles after :BindToClose() is in conflict with the ability of ProfileService to internally invoke profile release when an external session is requesting a profile session lock. Even so, the moment of profile release should in theory be the most vulnerable moment for data transaction attempts (e.g. take away items and store them elsewhere) as data is at most risk to not successfully save when the server is about to shut down (e.g. DataStore took too long to save).

ProfileService should not encourage data mutation right before profile release.