vibinex / chrome-extension

This chrome extension adds actionable overlays based on the company's data (code, deployments and success metrics)
GNU General Public License v3.0
11 stars 7 forks source link

Improve error handling and remove mutation observer #78

Closed tapishr closed 1 year ago

tapishr commented 1 year ago

The mutation observer used in our extension for listening to url changes is logically incorrect, we do not disconnect it, which ends up consuming too much processing as it triggers on every change of each tab in github and bitbucket. Removed it to implement message listening and url detection through chrome's tabs api, which is the most recommended, low resource consuming way to get url change.

Also improved error handling by creating promises around chrome apis. Their behavior with await then catch is not guaranteed by chrome.

Summary by CodeRabbit

Release Notes

These updates aim to improve the application's reliability, user experience, and performance.

coderabbitai[bot] commented 1 year ago

Walkthrough

The changes primarily focus on improving error handling, enhancing code modularity, and optimizing data retrieval from local storage. The code now uses custom functions for Chrome storage operations, and the logic for checking user login status has been updated. Additionally, the code now handles URL changes on the current tab and triggers a content script accordingly.

Changes

File Summary
backgroundScript.js Improved error handling in chrome.storage.local.set and API calls. Added an event listener for URL changes on the current tab.
scripts/api.js Refactored apiCallOnprem function to include better error handling, optional query parameters, and storage operations.
scripts/init.js Replaced initialization logic with a listener for "urlUpdated" message from the background script.
scripts/orchestrator.js Updated orchestrator function to retrieve data from local storage and check user login status.
scripts/utilities.js Refactored destroyElement function and added new setStorage and getStorage functions for Chrome storage operations.

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.
vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

vibinex-code-review[bot] commented 1 year ago
Coverage Report from Vibinex The following reviewers have approved the PR: Reviewer Name Review Coverage
avikalpg 100.00%

Total Coverage for PR = 100.0%

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page

vibinex-code-review[bot] commented 1 year ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
avikalpg 100.00%

Auto-assigning to following reviewers: avikalpg

Code coverage is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com. To change comment and auto-assign settings, go to your Vibinex settings page.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication