Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-16719] [COMMUNITY] Debounce requestIdleCallback a single time every 100ms, as opposed to call requestIdleCallback on debounce method #12695

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

cagonzalezcs
Copy link
Contributor

Potential fix for #12031

🎟️ Tracking

📔 Objective

📸 Screenshots

⏰ 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

@cagonzalezcs cagonzalezcs requested a review from a team as a code owner January 5, 2025 01:51
@bitwarden-bot
Copy link

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

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 [COMMUNITY] Debounce requestIdleCallback a single time every 100ms, as opposed to call requestIdleCallback on debounce method [PM-16719] [COMMUNITY] Debounce requestIdleCallback a single time every 100ms, as opposed to call requestIdleCallback on debounce method Jan 5, 2025
@djsmith85 djsmith85 linked an issue Jan 5, 2025 that may be closed by this pull request
1 task
jprusik
jprusik previously approved these changes Jan 6, 2025
@jprusik jprusik self-assigned this Jan 6, 2025
@jprusik
Copy link
Contributor

jprusik commented Jan 6, 2025

Hey @cagonzalezcs , thanks for taking this on! Based on the linked issue, I think this makes sense at the code-level. I want to do some testing before we move it forward, but will report back here once that's completed.

@jprusik jprusik added the needs-qa Marks a PR as requiring QA approval label Jan 13, 2025
…s opposed to call requestIdleCallback on debounce method

Potential fix for bitwarden#12031
@jprusik
Copy link
Contributor

jprusik commented Jan 13, 2025

A note; I rebased the branch since the basis was quite old.

I've tested and sent this PR along to our QA team; assuming no issues are found, we should then be able to merge this in!

edit: Looks like I was premature; there are some failing unit tests that need to be fixed. I have to put this down for now, but will come back to it.

Copy link
Contributor

github-actions bot commented Jan 13, 2025

Logo
Checkmarx One – Scan Summary & Details5a4ffedf-8820-46bb-baf0-247beda1386e

Fixed Issues (173)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-apps-dialog.component.html: 15
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-members-dialog.component.html: 17
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 467
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 494
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /libs/vault/src/components/download-attachment/download-attachment.component.ts: 29
MEDIUM Client_Privacy_Violation /libs/vault/src/components/download-attachment/download-attachment.component.ts: 29
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 222
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/desktop/src/vault/app/vault/view.component.html: 219
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 103
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/view.component.ts: 78

More results are available on the CxOne platform

@cagonzalezcs
Copy link
Contributor Author

@jprusik I'll take some time later today to fix the tests. I think I know exactly why they're breaking.

@cagonzalezcs
Copy link
Contributor Author

cagonzalezcs commented Jan 16, 2025

@jprusik Give it a shot now, I've updated the mocked debounce util within the collectAutofillContent test. Should be working now.

@jprusik jprusik removed the needs-qa Marks a PR as requiring QA approval label Jan 16, 2025
@jprusik jprusik merged commit 374ea6a into bitwarden:main Jan 16, 2025
29 of 30 checks passed
@jprusik
Copy link
Contributor

jprusik commented Jan 16, 2025

These changes have passed QA and have been merged; thanks so much for your work on this, @cagonzalezcs !

The updated code will go out with the next browser extension release

@jprusik
Copy link
Contributor

jprusik commented Jan 21, 2025

It looks like these changes fail our BIT testing for cases where the inputs are not initially available (e.g. https://webtests.dev/forms/login/multi-step-login/, https://webtests.dev/forms/login/hidden-login/). I'll take a closer look tomorrow to see if there's an alternate remedy to a revert.

@cagonzalezcs
Copy link
Contributor Author

@jprusik

Shoot, sorry about that... hmm... without digging into it, I can't think of why it wouldn't capture the mutation... I'll see if I can take a quick look at some point this week.

@jprusik
Copy link
Contributor

jprusik commented Jan 22, 2025

@jprusik

Shoot, sorry about that... hmm... without digging into it, I can't think of why it wouldn't capture the mutation... I'll see if I can take a quick look at some point this week.

No worries at all; I've put together a PR for a partial revert for now, which restores to original autofill/inline menu behaviours that were lost:
#13018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance Issue with Autofill Functionality in Vite + Vue 3 Application
3 participants