Starnamics / Minimal

Minimal is an open-source admin commands module which allows developers to easily create fully custom commands to improve their game.
MIT License
1 stars 0 forks source link

Safer API #1

Open 7kayoh opened 3 years ago

7kayoh commented 3 years ago

The system stays responsive in the face of failure. This applies not only to highly-available, mission-critical systems — any system that is not resilient will be unresponsive after a failure. Resilience is achieved by replication, containment, isolation and delegation. Failures are contained within each component, isolating components from each other and thereby ensuring that parts of the system can fail and recover without compromising the system as a whole. Recovery of each component is delegated to another (external) component and high-availability is ensured by replication where necessary. The client of a component is not burdened with handling its failures.

from the Reactive Manifesto


The current API uses many unsafe method to achieve data from the Roblox endpoint, as well as does not have a robust typechecker for arguments, for each method found in the API itself. Errors that are not predictable and is not caused by the user, such as Internal Server Errors, Timeouts, Forbidden errors coming from the Roblox endpoint will mess up the administration system, as now when it fails, it will just error without letting the user know, or at least try to call it again.

On the other hand, the code is not flexible enough, the API uses hardcoding to get the Players singleton (game.Players), which is not ideal nor optimal when you are open sourcing the system for public use, as you do not know whether the users have an anticheat system which renames every singletons into weird names or not, as well as you do not know whether did the user renamed Players to something else. Either of these two will cause the administration system to fail. Completely fails to meet the demand for a stable administration system that can be adopted by everyone for their Roblox experiences.


Typechecks can be done outside of the API method, but this will add a lot of duplicated code when done frequently, which isn't ideal as well. It's better to incorporate typechecks into the API anyway.


Right now, at this stage, I would say that this administration system is not anywhere comparable, compared to other popular administration systems such as SimpleAdmin, Cmdr, whatever. Just because it is "more easier", does not mean it is worth switching to yours unless it is reactive enough.

Starnamics commented 3 years ago

I'll be sure to improve the API and to use :GetService() instead of doing game.service, I'll also be improving the code to handle errors in a the next version.