vibinex / chrome-extension

This chrome extension adds actionable overlays based on the company's data (code, deployments and success metrics)
10 stars 6 forks source link

Revert "Improve error handling and remove mutation observer" #79

Closed avikalpg closed 11 months ago

avikalpg commented 11 months ago

Reverts Alokit-Innovations/chrome-extension#78

Summary by CodeRabbit

These changes aim to enhance the software's performance, reliability, and maintainability, providing a smoother user experience.

coderabbitai[bot] commented 11 months ago

Walkthrough

The changes primarily focus on improving error handling, code readability, and maintainability. The code now uses promises for asynchronous operations, and the chrome.storage.local.get method to retrieve data from local storage. The orchestrator function has been refactored to receive input parameters directly, and the setStorage and getStorage functions have been removed. The changes also include a more detailed description of the orchestrator function's purpose and functionality.

Changes

File Summary
backgroundScript.js The code now uses promises for asynchronous operations and includes additional .then calls to handle the response from the backend API.
scripts/api.js The function apiCallOnprem has been refactored to include a try-catch block for error handling and uses chrome.storage.local.get to retrieve the token.
scripts/init.js The script now initializes once the window is loaded, retrieves data from local storage, and sets up a MutationObserver to monitor changes in the document's body.
scripts/orchestrator.js The orchestrator function has been refactored to receive input parameters directly and includes a detailed description of its functionality.
scripts/utilities.js The destroyElement function has been simplified, and the setStorage and getStorage functions have been removed.

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 11 months ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
tapishr 99.25%
ajayVibinex 0.75%

Auto-assigning to following reviewers: tapishr ajayVibinex

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 11 months ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

vibinex-code-review[bot] commented 11 months ago
Relevant users for this PR: Contributor Name/Alias Code Coverage
tapishr 99.25%
ajayVibinex 0.75%

Auto-assigning to following reviewers: tapishr ajayVibinex

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.