Skip to content

Comments

[PM-23631] Delete unused jslib models and misc code#819

Merged
eliykat merged 14 commits intomainfrom
cleanup-jslib-unused-code
Jul 12, 2025
Merged

[PM-23631] Delete unused jslib models and misc code#819
eliykat merged 14 commits intomainfrom
cleanup-jslib-unused-code

Conversation

@eliykat
Copy link
Member

@eliykat eliykat commented Jul 10, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-23631

📔 Objective

Delete the last of the low-hanging unused code in jslib. This focused on entire files that were unused.

Corresponding get/set methods in StateService have been deleted. However, any account properties in Account and StateMigrationService have been left intact as these represent data structures saved to disk.

Note the small impact on the remaining files and actual app code.

There is still more work to do in this repo, however the remaining files are more tightly coupled and require a bit more thought before tackling - e.g. it's probably better to rewrite StateService with the methods and logic we actually need, rather than continuing to pare down the current implementation.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

eliykat added 7 commits July 10, 2025 11:24
- Delete cipher.ts, cipherView.ts, sortedCiphersCache.ts
- Delete search-ciphers.pipe.ts and icon.component files
- Remove cipher methods from StateService abstractions and implementations
- Remove unused IconComponent and SearchCiphersPipe from app.module.ts
- Preserve ciphers property in AccountData as 'any' type for data compatibility
…slib

- Delete cipherData.ts, cipherResponse.ts, linkedIdType.ts
- Delete field-related files (fieldData.ts, field.ts, fieldApi.ts, fieldView.ts)
- Delete sync, emergency access, and attachment upload response files
- Delete card and identity view files
- Delete linkedFieldOption decorator
- Change remaining references to 'any' type for compatibility
- Preserve data structure while removing type dependencies
- Delete Send domain models: send.ts, sendAccess.ts, sendFile.ts, sendText.ts
- Delete Send data models: sendData.ts, sendFileData.ts, sendTextData.ts
- Delete Send view models: sendView.ts, sendAccessView.ts, sendFileView.ts, sendTextView.ts
- Delete Send API models: sendFileApi.ts, sendTextApi.ts
- Delete Send response models: sendAccessResponse.ts, sendFileDownloadDataResponse.ts, sendFileUploadDataResponse.ts, sendResponse.ts
- Delete Send enum: sendType.ts
- Delete Send specs: send.spec.ts, sendAccess.spec.ts, sendFile.spec.ts, sendText.spec.ts
- Remove Send methods from StateService abstractions and implementations
- Remove getDecryptedSends/setDecryptedSends and getEncryptedSends/setEncryptedSends methods
- Change sends property in AccountData to 'any' type for data compatibility
- Fix import formatting and remove empty lines
- Delete Core domain models: card.ts, identity.ts, secureNote.ts, attachment.ts
- Delete Core data models: cardData.ts, identityData.ts, secureNoteData.ts, attachmentData.ts
- Delete Core view models: secureNoteView.ts, attachmentView.ts
- Delete Core API models: cardApi.ts, identityApi.ts, secureNoteApi.ts
- Delete Core response models: attachmentResponse.ts
- Delete Core enum: secureNoteType.ts
- Delete Core specs: card.spec.ts, identity.spec.ts, secureNote.spec.ts, attachment.spec.ts
- Delete folder and collection domain models, data models, view models,
  response models, and spec files
- Delete folder and collection domain models, data models, view models,
  response models, and spec files
- Remove 20 password manager specific interface methods:
  - Autofill methods (4): getAutoFillOnPageLoadDefault, setAutoFillOnPageLoadDefault, getEnableAutoFillOnPageLoad, setEnableAutoFillOnPageLoad
  - Browser integration methods (4): getEnableBrowserIntegration, setEnableBrowserIntegration, getEnableBrowserIntegrationFingerprint, setEnableBrowserIntegrationFingerprint
  - Notification methods (4): getDisableAddLoginNotification, setDisableAddLoginNotification, getDisableChangedPasswordNotification, setDisableChangedPasswordNotification
  - Favicon methods (2): getDisableFavicon, setDisableFavicon
  - Gravatar methods (2): getEnableGravitars, setEnableGravitars
  - Card/Identity tab methods (4): getDontShowCardsCurrentTab, setDontShowCardsCurrentTab, getDontShowIdentitiesCurrentTab, setDontShowIdentitiesCurrentTab
@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2025

Logo
Checkmarx One – Scan Summary & Details96696d37-64d9-4310-8f97-cdd12d0748b1

Great job, no security vulnerabilities found in this Pull Request

@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 7.72%. Comparing base (a643175) to head (a98d975).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #819      +/-   ##
=========================================
- Coverage   12.60%   7.72%   -4.89%     
=========================================
  Files          68      68              
  Lines        2760    2757       -3     
  Branches      477     477              
=========================================
- Hits          348     213     -135     
- Misses       2384    2529     +145     
+ Partials       28      15      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eliykat eliykat changed the title Cleanup jslib unused code [PM-23631] Delete unused jslib models and misc code Jul 10, 2025
@eliykat eliykat marked this pull request as ready for review July 10, 2025 03:34
@eliykat eliykat requested a review from a team as a code owner July 10, 2025 03:34
@eliykat eliykat requested a review from JimmyVo16 July 10, 2025 03:34
@sonarqubecloud
Copy link

@eliykat eliykat merged commit 3715df4 into main Jul 12, 2025
20 checks passed
@eliykat eliykat deleted the cleanup-jslib-unused-code branch July 12, 2025 04:23
sso-bitwarden pushed a commit to sso-bitwarden/directory-connector that referenced this pull request Aug 28, 2025
* Remove unused cipher-related code from jslib

- Delete cipher.ts, cipherView.ts, sortedCiphersCache.ts
- Delete search-ciphers.pipe.ts and icon.component files
- Delete cipherData.ts, cipherResponse.ts, linkedIdType.ts
- Delete field-related files (fieldData.ts, field.ts, fieldApi.ts, fieldView.ts)
- Delete sync, emergency access, and attachment upload response files
- Delete card and identity view files
- Delete linkedFieldOption decorator
- Remove cipher methods from StateService abstractions and implementations
- Preserve ciphers property in AccountData as 'any' type for data compatibility

* Remove unused Send feature and related password manager code from jslib

- Delete Send domain models: send.ts, sendAccess.ts, sendFile.ts, sendText.ts
- Delete Send data models: sendData.ts, sendFileData.ts, sendTextData.ts
- Delete Send view models: sendView.ts, sendAccessView.ts, sendFileView.ts, sendTextView.ts
- Delete Send API models: sendFileApi.ts, sendTextApi.ts
- Delete Send response models: sendAccessResponse.ts, sendFileDownloadDataResponse.ts, sendFileUploadDataResponse.ts, sendResponse.ts
- Delete Send enum: sendType.ts
- Delete Send specs: send.spec.ts, sendAccess.spec.ts, sendFile.spec.ts, sendText.spec.ts
- Remove Send methods from StateService abstractions and implementations
- Remove getDecryptedSends/setDecryptedSends and getEncryptedSends/setEncryptedSends methods
- Change sends property in AccountData to 'any' type for data compatibility
- Fix import formatting and remove empty lines

* Remove misc unused password manager models from jslib

- Delete Core domain models: card.ts, identity.ts, secureNote.ts, attachment.ts
- Delete Core data models: cardData.ts, identityData.ts, secureNoteData.ts, attachmentData.ts
- Delete Core view models: secureNoteView.ts, attachmentView.ts
- Delete Core API models: cardApi.ts, identityApi.ts, secureNoteApi.ts
- Delete Core response models: attachmentResponse.ts
- Delete Core enum: secureNoteType.ts
- Delete Core specs: card.spec.ts, identity.spec.ts, secureNote.spec.ts, attachment.spec.ts

* Remove unused Organization files (folders/collections)

- Delete folder and collection domain models, data models, view models,
  response models, and spec files

* Remove unused UI/UX settings methods from state service

- Remove 20 password manager specific interface methods:
  - Autofill methods (4): getAutoFillOnPageLoadDefault, setAutoFillOnPageLoadDefault, getEnableAutoFillOnPageLoad, setEnableAutoFillOnPageLoad
  - Browser integration methods (4): getEnableBrowserIntegration, setEnableBrowserIntegration, getEnableBrowserIntegrationFingerprint, setEnableBrowserIntegrationFingerprint
  - Notification methods (4): getDisableAddLoginNotification, setDisableAddLoginNotification, getDisableChangedPasswordNotification, setDisableChangedPasswordNotification
  - Favicon methods (2): getDisableFavicon, setDisableFavicon
  - Gravatar methods (2): getEnableGravitars, setEnableGravitars
  - Card/Identity tab methods (4): getDontShowCardsCurrentTab, setDontShowCardsCurrentTab, getDontShowIdentitiesCurrentTab, setDontShowIdentitiesCurrentTab

* Fix build errors

* Delete leftover data models and stateService methods

* Delete iframes and passwordReprompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants