Skip to content

[PM-25903] [PM-25590] BWDC doesn't sync new users unless cache is cleared - #879

Closed
sso-bitwarden wants to merge 887 commits into
bitwarden:mainfrom
sso-bitwarden:fix_sync_cache
Closed

[PM-25903] [PM-25590] BWDC doesn't sync new users unless cache is cleared#879
sso-bitwarden wants to merge 887 commits into
bitwarden:mainfrom
sso-bitwarden:fix_sync_cache

Conversation

@sso-bitwarden

@sso-bitwarden sso-bitwarden commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

🎟️ Tracking

📔 Objective

The purpose of the cache is not to make API call if there is no new changes to the directory data.

Bug: The directory connector never sync data after the first initial sync. This is because there is a condition the prevented that.

The fix: Remove that condition because the hashLegacy is never used anyway.

📸 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

renovate Bot and others added 30 commits April 29, 2024 09:59
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…en#507)

* Add user list under each group when doing test sync

* run prettier and lint, replace '@' with &bitwarden#64;
* Include action to support Checkmarx and Sonar

* Update .github/workflows/scan.yml

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

* Update .github/workflows/scan.yml

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

* Bump versions for outdated github actions

---------

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
* Configure Codecov coverage and results

* Actually produce reports
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This was previously set to ~10.4, but there is no node version that
satisifed the constraint of node ~18 and npm ~10.4.

This change follows the approach in the main `clients` repository.
* Delete NotificationsService

* Remove SyncService

* Delete VaultTimeoutService

* Remove ProviderService

* Remove UserVerificationService

* Remove SendService

* Remove EventService

* Remove PasswordRepromptService

* Remove UsernameGenerationService

* Remove TotpService

* Remove CollectionService

* Remove FolderService

* Remove AuditService

* Remove CipherService and SearchService together

* Remove FileUploadService

* Remove SettingsService

* Remove SystemService

* Remove ElectronCryptoService

* Remove unused deps
* [deps]: Update prettier to v3.3.3

* Run prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate Bot and others added 19 commits July 29, 2025 14:50
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…n#785)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@sso-bitwarden
sso-bitwarden requested a review from a team as a code owner September 17, 2025 07:22
@CLAassistant

CLAassistant commented Sep 17, 2025

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 7 committers have signed the CLA.

✅ jrmccannon
✅ sso-bitwarden
✅ vincentsalucci
✅ eliykat
❌ BTreston
❌ pixman20
❌ mandreko-bitwarden
You have signed the CLA already but the status is still pending? Let us recheck it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 7 committers have signed the CLA.

✅ eliykat
✅ jrmccannon
✅ sso-bitwarden
✅ vincentsalucci
❌ BTreston
❌ pixman20
❌ mandreko-bitwarden
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov

codecov Bot commented Sep 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.55172% with 31 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@8dc2be7). Learn more about missing BASE report.
⚠️ Report is 17 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ervices/ldap-directory.service.integration.spec.ts 0.00% 30 Missing ⚠️
src/services/sync.service.integration.spec.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #879   +/-   ##
=======================================
  Coverage        ?   13.15%           
=======================================
  Files           ?       68           
  Lines           ?     2805           
  Branches        ?      483           
=======================================
  Hits            ?      369           
  Misses          ?     2409           
  Partials        ?       27           

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

@bitwarden-bot

Copy link
Copy Markdown

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-25903
Link: https://bitwarden.atlassian.net/browse/PM-25903

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title [PM-25590] BWDC doesn't sync new users unless cache is cleared [PM-25903] [PM-25590] BWDC doesn't sync new users unless cache is cleared Sep 17, 2025
@JimmyVo16

Copy link
Copy Markdown
Contributor

@sso-bitwarden Can you fill out the Objective, including details of the problem and solution? Also, add any screenshots of test artifacts (if there are any) or anything else you feel is relevant.

@bitwarden-bot

Copy link
Copy Markdown

Thank you for reporting this issue! We've added this to our internal tracking system.
ID: PM-26176

@eliykat eliykat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Following up on our Slack discussions. Please feel free to open a new PR if you find the solution, otherwise it'll be picked up by AC Team soon. For now I'll close this one.

const lastHash = await this.stateService.getLastSyncHash();

return lastHash == null || (hashResult.hash !== lastHash && hashResult.hashLegacy !== lastHash);
return lastHash == null || hashResult.hash !== lastHash;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed, it doesn't seem like this will fix the issue: hashResult.hashLegacy !== lastHash will always evaluate to true (not false) because nobody should be using the legacy hash anymore; but that means it could never block a sync here.

@eliykat eliykat closed this Oct 3, 2025
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.