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-12308][Defect] Immediately vault timeout causes locking while using the extension #11344

Conversation

coroiu
Copy link
Contributor

@coroiu coroiu commented Oct 1, 2024

🎟️ Tracking

📔 Objective

Fix bug where the vault locks even when interacting with it when timeout is set to Immediately in Chrome.

The fix

Only load vault timeout setting service in the background. This should be ok since the vault timeout checks are properly scheduled using MV3 compatible alarms.

Root cause

Lock works by VaultTimeoutService constantly calling checkVaultTimeout at regular intervals. One of the conditions that this function checks is if the extension has any views open, it does this by calling platformUtilsService.isViewOpen(). This function in turn uses the following call to verify if this is the case:

await BrowserApi.sendMessageWithResponse("checkVaultPopupHeartbeat")

Now, the main issue is that as we transitioned to MV3 we started creating creating the background services in the popup too. This includes VaultTimeoutService which in turn uses PlatformUtilsService which depends on sending messages to any views present. However, this mechanism doesn't work when the message originates form within the view itself, meaning that this function will never get a response, causing it to think there are no views open, which in turns locks the extension.

📸 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

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 33.23%. Comparing base (430741a) to head (fb5661f).
Report is 68 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/browser/src/background/main.background.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11344      +/-   ##
==========================================
- Coverage   35.18%   33.23%   -1.96%     
==========================================
  Files        2727     2730       +3     
  Lines       85175    85258      +83     
  Branches    16204    16222      +18     
==========================================
- Hits        29973    28333    -1640     
- Misses      54202    54669     +467     
- Partials     1000     2256    +1256     

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

Copy link
Contributor

github-actions bot commented Oct 1, 2024

Logo
Checkmarx One – Scan Summary & Details2cf569d2-5ec8-4518-9b9a-bd752de83694

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3

Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

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

Great find!

@coroiu coroiu added needs-qa Marks a PR as requiring QA approval and removed needs-qa Marks a PR as requiring QA approval labels Oct 1, 2024
@coroiu coroiu merged commit 29db451 into main Oct 3, 2024
28 of 29 checks passed
@coroiu coroiu deleted the PM-12308-defect-immediately-vault-timeout-causes-locking-while-using-the-extension branch October 3, 2024 11:11
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.

2 participants