Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fedemkr
Copy link
Member

@fedemkr fedemkr commented Sep 23, 2025

🎟️ Tracking

PM-25993

📔 Objective

Automatically select default user collection when adding a new cipher if present.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • 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

@fedemkr fedemkr requested review from a team and matt-livefront as code owners September 23, 2025 16:50
@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2025

Logo
Checkmarx One – Scan Summary & Details456fd99b-ff82-47aa-ae96-67d30169d56f

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.27%. Comparing base (f80124a) to head (2c54159).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1973   +/-   ##
=======================================
  Coverage   81.27%   81.27%           
=======================================
  Files         822      822           
  Lines       51951    51956    +5     
=======================================
+ Hits        42224    42229    +5     
  Misses       9727     9727           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MainActor
func test_perform_fetchCipherOptions_defaultUserCollection() async {
let collections: [CollectionView] = [
.fixture(id: "1", name: "Design", organizationId: "1", type: .defaultUserCollection),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Would it make sense to have a test where the default collection is not the first item in the collections? As well, is it possible for there to be two collections both marked as default (as the data certainly seems to indicate)? Should we test/handle that scenario as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand there can be only one default user collection per organization. However, there could be multiple default user collections generally if the user belongs to multiple organizations. For this scenario in particular where a single organization is selected then only one default collection should be present or it would be wrongly configured server side and I think there isn't much we can do about it.
I will add another test thought to check that only the first one gets selected if by any chance multiple are present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree that the business rules shouldn't allow it—but the API does (something something "make illegal states unrepresentable"), so I feel like making sure we have a test for that circumstance is a good idea.

@fedemkr fedemkr enabled auto-merge (squash) September 24, 2025 19:34
@fedemkr fedemkr merged commit 5e0c390 into main Sep 25, 2025
10 of 12 checks passed
@fedemkr fedemkr deleted the PM-25993/select-my-items-default-collection-on-add branch September 25, 2025 15:29
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.

4 participants