Skip to content

Commit efa167b

Browse files
committed
Update controller metadata docs with new properties`
1 parent 013b836 commit efa167b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/controller-guidelines.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,24 @@ export { FooController, getDefaultFooControllerState } from './FooController';
108108

109109
Each property in state has two pieces of metadata that must be specified. This instructs the client how to treat that property:
110110

111+
- `includeInDebugLogs` - Informs the client whether to include the property in debug state logs attached to Sentry events (`true`) or not (`false`). We must exclude any data that could potentially be personally identifying here, and we often also exclude data that is large and/or unhelpful for debugging.
112+
- `includeInStateLogs` - Informs the client whether to include the property in state logs downloaded by users (`true`) or not (`false`). We must exclude any sensitive data that we don't want our support team to have access to (such as private keys). We include personally-identifiable data related to on-chain state here (we never collect this data, and we have a disclaimer about this in the UI when users download state logs), but other types of personally identifiable information must still be excluded.
111113
- `persist` — Informs the client whether the property should be placed in persistent storage (`true`) or not (`false`). Opting out is useful if you want to have a property in state for convenience reasons but you know that property is ephemeral and can be easily reconstructed.
112-
- `anonymous` Informs the client whether the property is free of personally identifiable information (`true`) or not (`false`) and can therefore safely be included and sent to error reporting services such as Sentry. When in doubt, use `false`.
114+
- `usedInUi` - Informs the client whether the property is used in the UI (`true`) or not (`false`). This is used to filter the state we send to the UI to improve performance.
113115

114116
A variable named `${controllerName}Metadata` should be defined (there is no need to export it) and passed as the `metadata` argument in the constructor to `BaseController`.
115117

116118
```typescript
117119
const keyringControllerMetadata = {
118120
vault: {
121+
// This property can be used to identify a user, so we want to make sure we
122+
// do not include it in Sentry.
123+
includeInDebugLogs: false,
119124
// We don't want to include this in state logs because it contains sensitive key material.
120125
includeInStateLogs: false,
121126
// We want to persist this property so it's restored automatically, as we
122127
// cannot reconstruct it otherwise.
123128
persist: true,
124-
// This property can be used to identify a user, so we want to make sure we
125-
// do not include it in Sentry.
126-
anonymous: false,
127129
// This property is only used in the controller, not in the UI.
128130
usedInUi: false,
129131
},

0 commit comments

Comments
 (0)