You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if an error occurs within a Silo the Silo will break permanently due to a flag getting set not being unset (Silo thinks a modifier is running forever). Additionally, there's currently no way to determine if a dispatched modifier actually succeeded or not, and there is no way to detect failures.
This can result in data corruption. Using Silos for currency in this broken state allows for code to make any, and as many changes, and those modifications will never apply. This is particularly problematic when used to keep track of currency.
Additionally, while modifications are atomic, reads are not. If modifiers are still processing (such as a modifier which removes currency) the state becomes dangerous to read.
I would propose:
:Dispatch returns and uses a Promise-like, so failures can be handled, and modifiers can be awaited.
Modifiers have the ability to return a Promise-like.
Silo provides a method to wait for processing modifiers to ensure atomicity (Effectively a Promise.all for all of the modifier promises)
The text was updated successfully, but these errors were encountered:
The way redux solves this is by running the reducer (synonymous to modifiers in this case) in a try/finally block. That way, if the reducer fails, it is still able to mark itself as "done" to prevent it from hanging forever. Source.
So a possible solution without having to have promises is to just wrap the modifier call in pcall within Silo. For some reason, Redux has chosen not to add a catch clause and thus errors will probably be silent, but I'd at least like to output the error from the modifier call.
Ideally, modifiers should not yield either. I can check for that pretty easily and throw an error if it does yield.
Currently, if an error occurs within a Silo the Silo will break permanently due to a flag getting set not being unset (Silo thinks a modifier is running forever). Additionally, there's currently no way to determine if a dispatched modifier actually succeeded or not, and there is no way to detect failures.
This can result in data corruption. Using Silos for currency in this broken state allows for code to make any, and as many changes, and those modifications will never apply. This is particularly problematic when used to keep track of currency.
Additionally, while modifications are atomic, reads are not. If modifiers are still processing (such as a modifier which removes currency) the state becomes dangerous to read.
I would propose:
:Dispatch
returns and uses aPromise
-like, so failures can be handled, and modifiers can be awaited.Promise
-like.Silo
provides a method to wait for processing modifiers to ensure atomicity (Effectively aPromise.all
for all of the modifier promises)The text was updated successfully, but these errors were encountered: