* Add a small default time to limit timing failures
* Handle subscription race conditions
* Add Symbols to tracked emission types
This is a bit of a cheat, but Symbols can't be cloned, so
we need to nudge them to something we can handle.
They are rare enough that anyone hitting this is likely to
expect some special handling.
* Ref count state listeners to minimize storage activity
* Ensure statuses are updated
* Remove notes
* Use `test` when gramatically more proper
* Copy race and subscription improvements to single user
* Simplify observer initialization
* Correct parameter names
* Simplify update promises
test we don't accidentally deadlock along the `getFromState` path
* Fix save mock
* WIP: most tests working
* Avoid infinite update loop
* Avoid potential deadlocks with awaiting assigned promises
We were awaiting a promise assigned in a thenable. It turns out that
assignment occurs before all thenables are concatenated, which can cause
deadlocks. Likely, these were not showing up in tests because we're
using very quick memory storage.
* Fix update deadlock test
* Add user update tests
* Assert no double emit for multiple observers
* Add use intent to method name
* Ensure new subscriptions receive only newest data
TODO: is this worth doing for active user state?
* Remove unnecessary design requirement
We don't need to await an executing update promise, we
can support two emissions as long as the observable is
guaranteed to get the new data.
* Cleanup await spam
* test cleanup option behavior
* Remove unnecessary typecast
* Throw over coerce for definition options
Class based router guards are deprecated as of Angular 15.2, per angular.io/guide/deprecations#router-class-and-injection-token-guards. To simplify future angular upgrades we need to resolve these deprecations.
This PR migrates the HasPremium and DebounceNavigationService guards to use the new functional pattern.
* [PM-5048] Query params are not persisting in extension popout window
* [PM-5048] Reverting how we identify whether the user is popping out the current tab;
* [PM-5048] Adding jest test to validate skipping parsing of the extension path
* [PM-5048] Adding jest test to validate skipping parsing of the extension path
* [PM-5048] Reworking implementation to ensure that popout window query params remain persistent
* [PM-5048] Reworking implementation to ensure that appended query params do not remain persistent, but popout window query params do remain persistent. Fixing issues within vault item popouts and adding jest tests to verify those fixes
* [PM-5048] Modifying how query params are set within vault popout windows
* [PM-5048] Running prettier
* [AC-1139] Add new layout for MemberDialogComponent when FC feature flag is enabled
* [AC-1139] Deprecated Organization canEditAssignedCollections, canDeleteAssignedCollections, canViewAssignedCollections
* [AC-1139] Checking if FC feature flag is enabled when using canDeleteAssignedCollections or canViewAssignedCollections
* [AC-1139] Added missing parameter to customRedirect
* [AC-1139] Fixed canEdit permission
* [AC-1139] Fixed CanDelete logic
* [AC-1139] Changed canAccessVaultTab function to receive configService
* Override deprecated values on sync
* [AC-1139] Reverted change that introduced ConfigService as a parameter to canAccessVaultTab
* [AC-1139] Fixed circular dependency
* [AC-1139] Moved overriding of deprecated values to syncService
* Revert "[AC-1139] Fixed circular dependency"
This reverts commit 6484420976.
* Revert "Override deprecated values on sync"
This reverts commit f0c25a6996.
* [AC-1139] Added back the deprecation of methods canEditAssignedCollections, canDeleteAssignedCollections, canViewAssignedCollections
* [AC-1139] Reverted change on syncService
* [AC-1139] Override deprecated values on sync
* [AC-1139] Fix canDelete logic in
collection-dialog.component.ts and
bulk-delete-dialog.component.ts
* [AC-1139] Moved override logic from syncService to organizationService
* [AC-1139] Add ability to have titlecase titles on nested-checkbox.component checkboxes; use on member-dialog.component
* Revert "[AC-1139] Add ability to have titlecase titles on nested-checkbox.component checkboxes; use on member-dialog.component"
This reverts commit 9ede0fc5ac.
* [AC-1139] Fix bulk delete functionality
* [AC-1139] Refactor canEdit and canDelete to use ternary operator
* [AC-1139] Fix canDelete condition in VaultComponent
---------
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* [PM-4923] Form Elements that Fade into View Contain Incorrectly Cached Page Details
* [PM-4923] Form Elements that Fade into View Contain Incorrectly Cached Page Details
* [PM-4923] Running prettier on implementation
* [PM-5148] Removing Browser Autofill Override Setting and Add Message
* [PM-5148] Removing translation keys
* [PM-5148] Removing translation keys
* [PM-5148] Modifying how we present the link to users to ensure translations can be more effective
* Moved password-strength component to Tools
* Move zxcvbn into Tools ownership
zxcvbn is the library currently used to calculate the password-strength
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Provide helpers to build keys from KeyDefinitions
* Move usage comments to the helper class
* `npm run prettier` 🤖
* Prefer setters and getters to key builders
* Add documentation to migration helper methods
* Fix migration helper tests
* Prefer defined types to ad hoc
* `npm run prettier` 🤖
* Handle switch messaging
TODO: handle loading state for account switcher
* Async updates required for state
* Fallback to email for current account avatar
* Await un-awaited promises
* Remove unnecessary Prune
Prune was getting confused in browser and deleting memory in browser on
account switch. This method isn't needed since logout already removes
memory data, which is the condition for pruning
* Fix temp password in browser
* Use direct memory access until data is serializable
Safari uses a different message object extraction than firefox/chrome
and is removing `UInt8Array`s. Until all data passed into StorageService
is guaranteed serializable, we need to use direct access in state
service
* Reload badge and context menu on switch
* Gracefully switch account as they log out.
* Maintain location on account switch
* Remove unused state definitions
* Prefer null for state
undefined can be misinterpreted to indicate a value has not been set.
* Hack: structured clone in memory storage
We are currently getting dead objects on account switch due to updating
the object in the foreground state service. However, the storage service
is owned by the background. This structured clone hack ensures that all
objects stored in memory are owned by the appropriate context
* Null check nullable values
active account can be null, so we should include null safety in the
equality
* Correct background->foreground switch command
* Already providing background memory storage
* Handle connection and clipboard on switch account
* Prefer strict equal
* Ensure structuredClone is available to jsdom
This is a deficiency in jsdom --
https://github.com/jsdom/jsdom/issues/3363 -- structured clone is well
supported.
* Fixup types in faker class
* add avatar and simple navigation to header
* add options buttons
* add app-header to necessary pages
* add back button and adjust avatar sizes
* add helper text when account limit reached
* convert magic number to constant
* add clarifying comment
* adjust homepage header styles
* navigate to previousp page upon avatar click when already on '/account-switcher'
* move account UI to own component
* add i18n
* show correct auth status
* add aria-hidden to icons
* use listbox role
* add screen reader accessibility to account component
* more SR a11y updates to account component
* add hover and focus states to avatar
* refactor hover and focus states for avatar
* add screen reader text for avatar
* add slide-down animation on account switcher close
* remove comment
* setup account component story
* add all stories
* move navigation call to account component
* implement account lock
* add button hover effect
* implement account logout
* implement lockAll accounts functionality
* replace 'any' with custom type
* add account switcher button to /home login page
* use <main> tag (enables scrolling)
* change temp server filler name
* temporarily remove server arg from account story
* don't show avatar on /home if no accounts, and don't show 'lock'/'logout' buttons if no currentAccount
* add translation and a11y to /home avatar
* add correct server url to account component
* add 'server' to AccountOption type
* Enabled account switching client-side feature flag.
* add slide-in transition to /account-switcher page
* change capitalization to reflect figma design
* make screen reader read active account email, address more capitalization
* fix web avatar misalignment
* make avatar color based on user settings and in sync with other clients
* make property private
* change accountOptions to availableAccounts for clarity
* refactor to remove 'else' template ref
* remove empty scss rule
* use tailwind instead of scss
* rename isSelected to isActive
* add 'isButton' to /home page avatar
* move files to services folder
* update import
* Remove duplicate active account button
* Move no account button to current-account component
* Always complete logging out
Fixes PM-4866
* make screenreader read off email, not name
* refactor avatar for button case
* Do not next object updates
StateService's init was calling `updateState` at multiple layers,
once overall and then again for each account updated. Because
we were not maintaining a single state object through the
process, it was ending up in a consistent, but incomplete state.
Fixed by returning the updated state everywhere. This very well
may not be all the bugs associated with this
* Treat null switch account as no active user
* Listen for switchAccountFinish before routing (#6950)
* adjust avatar style when wrapped in a button
* show alt text for favicon setting
* move stories to browser
* Send Finish Message on null
* Dynamically set active user when locking all
This is required because some user lock states are not recoverable after
process reload (those with logout timeout). This waits until reload is
occurring, then sets the next user appropriately
* Move Finished Message to Finally Block
Fix tests
* Drop problematic key migration
Fixes PM-4933. This was an instance of foreground/background collision
when writing state. We have several other fallbacks of clearing
these deprecated keys.
* Prefer location to homebrew router service
* Initialize account disk cache from background
Uses the `isRecoveredSession` bool to re-initialize foreground caches
from a background message. This avoids a lengthy first-read for
foregrounds
* PM-4865 - Browser Acct Switcher - only show lock btn for lockable accounts (#6991)
* Lock of active account first, when locking multiple.
Fixes PM-4996
* Fix linter
* Hide lock now for locked users (#7020)
* Hide lock now for locked users
* Prefer disabling button to removing
* Add tooltip to TDE without unlock method
* Load all auth states on state init (#7027)
This is a temporary fix until the owning services can update state
themselves. It uses the presence of an auto key to surmise unlocked
state on init. This is safe since it's run only once on extension start.
* Ps/pm 5004/add load to account switcher (#7032)
* Add load spinner to account switcher
* Remove ul list icons
* Properly size account switcher in popout
* [PM-5005] Prevent Double Navigation (#7035)
* Delete Overriden Method
* Add Lock Transition
* truncate email and server name
* remove account.stories.ts (will add in separate PR)
* Do not switch user at reload if no user is active
* fix prettier issues
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
* Move tldts into ownership of autofill
This was initially introduced by me, but is largely used for validating urls for autofill.
* Move @types/jsdom and jsdom to tools
This dependency is only using within the importers in the cli (running node)
* Add oidc-client-ts to tools
This dependency got introduced with the Lastpass direct import
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>