Closed Nidoxs closed 1 month ago
Thanks for the issue, Lapis should definitely have this feature!
Yeah, having a way to read data without imposing a session lock would be great!
I've been thinking about this and I'm not sure how it should work with migrations. Would you expect this to return API to return data with an outdated migration version?
Maybe it runs the migration code locally but doesn't save that data back?
Either way feels like it's a 'gotcha' territory.
Maybe it runs the migration code locally but doesn't save that data back?
I think applying a temporary unsaved migration is a necessary compromise for the proposed read-only mode.
I certainly don't have a use case for reading data that is out of date, so I think the natural step there is just running whatever migration is needed to bring the data up to date.
Even if we did run the migration, you could have a situation where a server reads a document with a migration version higher than its own.
That could still happen on it's normal write mode though? So I don't think it's in the scope of this issue?
If you load a document that has a higher migration version than the servers, it will error and not load the document. We could do that here as well. I just don't know the specific use-cases people have for a read-only mode, so I don't know if that's acceptable.
I think it makes the most sense to return the data migrated to the version that the server calling it expects.
I think it makes the most sense to return the data migrated to the version that the server calling it expects.
I agree, but if it is passed the server's migration version, you would expect it to error then?
I think it makes the most sense to return the data migrated to the version that the server calling it expects.
I agree, but if it is passed the server's migration version, you would expect it to error then?
Yes
Resolved with #59.
It would be useful to have a way to read a player's data while they're not in the game. For example, if there's a leaderboard system where it shows the top 3 players on podiums and you want to show things they own like skins, guns etc. The read-only feature would allow you to load their data and hold it temporarily to extract the value(s) you need.
I believe ProfileService has a similar feature.
Thanks! 👍