Goal is to build a better version of clearCaches, where a HoistService can spec out a set of actions it wishes to expose via the Hoist Admin Console "Services" tab.
Each "action" could map onto a method on the server. Actions could be given an admin-friendly displayName, which I envision Hoist React rendering as the text on a button. Any HOIST_ADMIN could call any defined action via the Services tab, without app devs needing to write a dedicated controller.
Actions could also be spec'd as primaryOnly, meaning they would only be enabled on the primary instance.
Could also consider supporting:
description - explanation / hint as to what it does, if name not enough
intent - or potentially some flag like isDisruptive (???) - mainly I want a way to signal that some service actions are "fine to do anytime - don't hesitate to press this green button to request a refresh" vs. "this will drop the core business data cache and all users will start seeing failed refreshes or exceptions until state can be rebuilt". Could be handled by description or name, just like the idea of green vs. red button TBH
Would want to decide / plan ahead as to support for accepting args. I am wary of growing the scope in that way - seems like a significant additional complexity - but understand that certain actions might need an arg to be useful - although some use cases could be handled by adding additional methods.
If successful, could replace ambiguous clearCaches entirely.
Goal is to build a better version of clearCaches, where a HoistService can spec out a set of actions it wishes to expose via the Hoist Admin Console "Services" tab.
Each "action" could map onto a method on the server. Actions could be given an admin-friendly
displayName
, which I envision Hoist React rendering as the text on a button. Any HOIST_ADMIN could call any defined action via the Services tab, without app devs needing to write a dedicated controller.Actions could also be spec'd as
primaryOnly
, meaning they would only be enabled on the primary instance.Could also consider supporting:
description
- explanation / hint as to what it does, if name not enoughintent
- or potentially some flag likeisDisruptive
(???) - mainly I want a way to signal that some service actions are "fine to do anytime - don't hesitate to press this green button to request a refresh" vs. "this will drop the core business data cache and all users will start seeing failed refreshes or exceptions until state can be rebuilt". Could be handled by description or name, just like the idea of green vs. red button TBHWould want to decide / plan ahead as to support for accepting args. I am wary of growing the scope in that way - seems like a significant additional complexity - but understand that certain actions might need an arg to be useful - although some use cases could be handled by adding additional methods.
If successful, could replace ambiguous
clearCaches
entirely.