Skip to content

Improve KDoc on StateFlowExtensions#6338

Merged
SaintPatrck merged 3 commits intomainfrom
update-state-flow-ext-docs
Jan 9, 2026
Merged

Improve KDoc on StateFlowExtensions#6338
SaintPatrck merged 3 commits intomainfrom
update-state-flow-ext-docs

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

🎟️ Tracking

Documentation

📔 Objective

Enhance the KDoc for the observeWhenSubscribedAndLoggedIn and observeWhenSubscribedAndUnlocked extension functions.

The objective is to provide clearer, more detailed documentation for developers and LLMs. The new comments explain the lazy invocation behavior, clarify how subscriptionCount is used for detecting external collectors, describe the observer's lifecycle, and include common usage patterns with code examples. This helps prevent misuse and improves understanding of when the expensive operations within the observers will be triggered or canceled.

⏰ 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

This commit enhances the KDoc for the `observeWhenSubscribedAndLoggedIn` and `observeWhenSubscribedAndUnlocked` extension functions.

The objective is to provide clearer, more detailed documentation for developers and LLMs. The new comments explain the lazy invocation behavior, clarify how `subscriptionCount` is used for detecting external collectors, describe the observer's lifecycle, and include common usage patterns with code examples. This helps prevent misuse and improves understanding of when the expensive operations within the observers will be triggered or canceled.
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:misc Change Type - ¯\_(ツ)_/¯ labels Jan 8, 2026
@SaintPatrck SaintPatrck added the ai-review Request a Claude code review label Jan 8, 2026
@SaintPatrck SaintPatrck marked this pull request as ready for review January 8, 2026 21:05
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 8, 2026

Claude finished @SaintPatrck's task in 2m 7s —— View job


Overall Assessment: APPROVE

This PR enhances KDoc documentation for observeWhenSubscribedAndLoggedIn and observeWhenSubscribedAndUnlocked extension functions. The new documentation accurately describes lazy invocation behavior, subscription detection mechanics, lifecycle management, and includes practical code examples. All technical details were verified against actual usage patterns in the codebase and Kotlin Flow documentation.

Code Review Details

No issues found. The documentation improvements are:

  • Technically accurate regarding subscriptionCount behavior
  • Well-structured with clear sections (Subscription Detection, Common Pattern, Observer Lifecycle)
  • Include correct code examples matching real usage patterns
  • Properly cross-referenced between related functions
  • Follow KDoc conventions

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 8, 2026

Logo
Checkmarx One – Scan Summary & Detailsb8846225-690c-438e-8598-8413df85bfcc

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

@SaintPatrck SaintPatrck enabled auto-merge January 8, 2026 21:20
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (eff4ce7) to head (6906204).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6338   +/-   ##
=======================================
  Coverage   85.49%   85.49%           
=======================================
  Files         764      764           
  Lines       54724    54724           
  Branches     7881     7881           
=======================================
  Hits        46785    46785           
  Misses       5201     5201           
  Partials     2738     2738           

☔ 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.

* there are no subscribers to the [MutableStateFlow] or the vault is not unlocked.
* Lazily invokes the [observer] callback only when this MutableStateFlow has external collectors,
* the user is authenticated, and their vault is unlocked. Designed for expensive operations that
* should only run when UI actively observes the resulting data.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks nice, only thing I can thing of is adding something about how it emits for the active user.

What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good distinction. 👍

@github-actions github-actions Bot removed the ai-review Request a Claude code review label Jan 9, 2026
@SaintPatrck SaintPatrck added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 41dfc2b Jan 9, 2026
18 of 19 checks passed
@SaintPatrck SaintPatrck deleted the update-state-flow-ext-docs branch January 9, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:misc Change Type - ¯\_(ツ)_/¯

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants