Skip to content

Conversation

@matt-livefront
Copy link
Collaborator

@matt-livefront matt-livefront commented Dec 11, 2025

🎟️ Tracking

PM-28339

📔 Objective

When FetchedResultsSubscription is initialized, it performs an initial fetch of the fetch request. If the subscription is created on the main thread, which is often the case when subscribing to data in a processor, this occurs on the main thread. The fetch itself occurs on a background context (#2165), but performFetch() is synchronous and waits for the results. After adding the serial queue in the previous PR, this is an easy thing to also move into the background.

Overall Summary:

Metric Baseline After Change Δ (%)
Hitch Duration (ms) 150.5 86.7 -43%
Avg Hitch Duration (ms) 44.6 34.7 -22%
Max Hitch Duration (ms) 80 60 -25%
Run Details

Baseline:

Duration (ms) Average (ms) Max (ms)
291.7 58.3 133.3
65.7 32.9 50
183.4 61.1 100
133.3 44.5 66.7
78.3 26.1 50

After Change

Duration (ms) Average (ms) Max (ms)
91.7 30.6 66.7
91.7 22.9 50
91.7 22.9 50
66.7 66.7 66.7
91.7 30.6 66.7

This was a result of profiling 5 runs before and after on startup on an iPhone 13 Pro.

⏰ 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

@matt-livefront matt-livefront requested a review from a team as a code owner December 11, 2025 22:02
@claude
Copy link

claude bot commented Dec 11, 2025

Claude finished @matt-livefront's task in 2m 10s —— View job


Code Review Complete

  • Analyzing PR changes
  • Running code review
  • Posting findings

Review Summary: Changes look good overall. The PR successfully moves the blocking performFetch() operation to a background context, achieving significant performance improvements (43% reduction in hitch duration). The implementation properly serializes access through the queue and handles errors consistently.

The bitwarden-code-reviewer agent has posted detailed inline comments and a summary. Please review those for specific feedback.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Logo
Checkmarx One – Scan Summary & Details7acbae50-e2da-4966-b8f6-df2a579e16d8

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

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.23%. Comparing base (c3d3862) to head (11b38ee).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...e/Platform/Utilities/FetchedResultsPublisher.swift 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2193      +/-   ##
==========================================
- Coverage   85.50%   84.23%   -1.27%     
==========================================
  Files        1740     1978     +238     
  Lines      147301   162364   +15063     
==========================================
+ Hits       125943   136771   +10828     
- Misses      21358    25593    +4235     

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

fedemkr
fedemkr previously approved these changes Dec 15, 2025
@matt-livefront matt-livefront force-pushed the matt/PM-28339-fetched-results-controller branch from bf82aaa to eb7bfc6 Compare December 15, 2025 16:56
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.

3 participants