-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add State Provider Framework Deep Dive #248
base: main
Are you sure you want to change the base?
Conversation
No New Or Fixed Issues Found |
Co-authored-by: Matt Gibson <[email protected]>
Deploying contributing-docs with Cloudflare Pages
|
Co-authored-by: Matt Gibson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seagulling with just a couple things I noticed with a quick read, really for my OCD.
Co-authored-by: Matt Bishop <[email protected]>
Co-authored-by: audrey-jensen <[email protected]>
* First pass at derived state documentation * `npm run prettier` 🤖 * Apply suggestions from code review Co-authored-by: Matt Bishop <[email protected]> --------- Co-authored-by: Matt Bishop <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this, but I'll leave it to @withinfocus since I worked on this quite a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started getting a bit wild with copyediting. There are a few still-missing sections I assume need filling in, or strike them from the PR perhaps?
|
||
## Structure | ||
|
||
![State Diagram](State_Diagram.svg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌱 I'm noticing a lot of variety in our diagrams. Would be nice to standardize on look and feel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably used Excalidraw, whereas we've previously used PlantUML. I personally like the slightly less formal style of this diagram, but if we'd like standardization I can move this to PlantUML if it would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possibility is to use a markdown-compatible renderer, such as mermaid or GoAT.
Co-authored-by: Matt Bishop <[email protected]>
#296) * Added optional constructor parameter and updated mapping instructions. * Fixed table * Changed verbiage. * Updated verbiage.
…itwarden/contributing-docs into add-state-provider-framework-deep-dive
Well it has only been 8 months but I'd love to try and merge this in 🫤. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an exhaustive review because I want to see this merge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 I also want to see this merged. Feedback is provided, but I'm totally cool with it landing in a followup PR. :)
|
||
::: | ||
|
||
#### `StateDefinition` | ||
|
||
:::note | ||
|
||
Secure storage is not currently supported as a storage location in the State Provider Framework. For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Is secure storage just a description, or does it refer to an emerging web api?
The Platform team will be responsible to reviewing all new and updated entries in this file and will | ||
be looking to make sure that there are no duplicate entries containing the same state name and state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ Consider using present tense.
The framework provides both `KeyDefinition` and `UserKeyDefinition` for teams to use. The | ||
`UserKeyDefinition` should be used for defining pieces of state that are scoped at a user level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ Consider stating this as an instruction. "Use UserKeyDefinition
for state scoped to a user and KeyDefinition
for user-independent state." or similar.
[`KeyDefinitionOptions`](#keydefinitionoptions). | ||
The arguments for defining a `KeyDefinition` or `UserKeyDefinition` are: | ||
|
||
| Argument | Usage | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 Love presenting the options and arguments using tables!
@@ -172,6 +200,13 @@ class FolderService { | |||
|
|||
### `ActiveUserState<T>` | |||
|
|||
:::warning | |||
|
|||
`ActiveUserState` has problems with consider not using it anymore, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ Looks like you a word. "ActiveUserState
has race condition problems. Do not use it for updates and consider transitioning your code to SingleUserState instead."
Objective
To document the newly added State Provider Framework added in bitwarden/clients#6640 and refined in bitwarden/clients#6860.