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
We can make recoverable introspectable config for #27 and make protection settings more robust by introducing "dynamic configuration values". This will basically be the successor the "ProtectionSettings", but more generic, as they will be used for Draupnir's account data too.
So there are two concepts. Dynamic configuration, and dynamic configuration values. The configuration represents the entire unit, so ProtectionSettings or the PolicyRoomsConfig. There are three states that a DynamicConfiguration can be in once it has parsed serialized data.
Unable to deserialize from JSON at all, that's to say JSON.parse failed.
This includes schema migration issues.
Specific configuration values fail to validate.
Collections either contain invalid values, or the collection has been replaced with another value, like number or string.
All specific configuration values are valid.
This is not the end of the story however, as in the case of PolicyRoomsConfig we can discover bad data well after parsing. For example, a room reference could be valid according to the schema but may not refer to any reachable matrix room (ie, it is impossible to join the room because no servers know of its existence). We would need to present the value causing this error as invalid within the context of the DynamicConfigurationValue so that the user is able to remove it. To do this, we will have to provide iterators for DynamicConfigurationCollection that provide both the value and its path information (so that it can be reported easily and hopefully prompts can be provided in Draupnir to remove the value specifically).
Acceptance Criteria
DynamicConfiguration interface exists that allows you to parse a config from a JSON object.
It has methods for what to do if a JSON object cannot be obtained whatsoever.
DynamicConfigurationValue interface exists
DynamicConfigurationCollection interface exists.
Tangent, why is collection any different to DynamicConfiguration isn't it just a nested thing where the key is a number instead.
Tangent, aren't we just recreating schema but with better traceability for what went wrong? Probably.
Tangent How would we even unify collections and objects.
I don't think we can even worry about this stuff now tbh.
The text was updated successfully, but these errors were encountered:
Description
We can make recoverable introspectable config for #27 and make protection settings more robust by introducing "dynamic configuration values". This will basically be the successor the "ProtectionSettings", but more generic, as they will be used for Draupnir's account data too.
So there are two concepts. Dynamic configuration, and dynamic configuration values. The configuration represents the entire unit, so
ProtectionSettings
or thePolicyRoomsConfig
. There are three states that aDynamicConfiguration
can be in once it has parsed serialized data.JSON.parse
failed.This is not the end of the story however, as in the case of
PolicyRoomsConfig
we can discover bad data well after parsing. For example, a room reference could be valid according to the schema but may not refer to any reachable matrix room (ie, it is impossible to join the room because no servers know of its existence). We would need to present the value causing this error as invalid within the context of theDynamicConfigurationValue
so that the user is able to remove it. To do this, we will have to provide iterators forDynamicConfigurationCollection
that provide both the value and its path information (so that it can be reported easily and hopefully prompts can be provided in Draupnir to remove the value specifically).Acceptance Criteria
DynamicConfiguration
interface exists that allows you to parse a config from a JSON object.DynamicConfigurationValue
interface existsDynamicConfigurationCollection
interface exists.DynamicConfiguration
isn't it just a nested thing where the key is a number instead.The text was updated successfully, but these errors were encountered: