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

feat: detect if SODA is behind a firewall #373

Merged
merged 33 commits into from
Nov 22, 2024
Merged

Conversation

aaronm-2112
Copy link
Member

@aaronm-2112 aaronm-2112 commented Nov 22, 2024

Checks for a firewall that prevents LAN communication to SODA server. Checks for network interference when connecting to Pennsieve (e.g., SSL/TLS issues, ropped requests, etc).

Summary by Sourcery

Introduce functionality to detect and notify users of potential firewall issues affecting SODA's connectivity to its server and Pennsieve. Enhance user experience by providing informative alerts and documentation links for troubleshooting network problems. Update CI workflow to accommodate changes related to firewall detection.

New Features:

  • Implement detection of firewall issues that prevent LAN communication to the SODA server and network interference when connecting to Pennsieve.

Enhancements:

  • Add user notifications for potential network issues and provide guidance on resolving them.

CI:

  • Update CI workflow to include a new branch 'detect-firewall'.

aaronm-2112 and others added 28 commits October 8, 2024 13:35
Copy link

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

Copy link
Contributor

sourcery-ai bot commented Nov 22, 2024

Reviewer's Guide by Sourcery

This PR implements network connectivity checks to detect if SODA is being blocked by firewalls. It adds functionality to detect both internal firewall issues (blocking communication with SODA server) and external firewall interference (blocking communication with Pennsieve). The implementation includes new UI components to notify users of potential network issues and provides guidance for resolution.

Sequence diagram for detecting firewall issues

sequenceDiagram
    actor User
    participant SODA
    participant Server
    participant Pennsieve

    User->>SODA: Start application
    SODA->>Server: Check server live status
    alt Server is live
        SODA->>User: Show potential network issues (internal firewall)
        User->>SODA: Restart SODA
    end

    SODA->>Pennsieve: Check external firewall interference
    alt Blocked by external firewall
        SODA->>User: Show potential network issues (external firewall)
    end
Loading

Updated class diagram for network connectivity checks

classDiagram
    class SODA {
        +serverIsLive()
        +clientBlockedByExternalFirewall(url)
    }

    class Swal {
        +fire(options)
        +close()
    }

    class ipcMain {
        +handle(channel, listener)
    }

    class ipcRenderer {
        +invoke(channel)
    }

    SODA --> Swal : uses
    SODA --> ipcMain : interacts
    SODA --> ipcRenderer : interacts

    note for SODA "Detects network issues and interacts with Swal for user notifications"
Loading

File-Level Changes

Change Details Files
Added firewall detection system for SODA server connectivity
  • Added global server live status tracking in the main process
  • Implemented server status monitoring through process events
  • Created new IPC bridge for server live status checks
  • Added UI dialog to notify users of potential firewall issues
src/main/index.js
src/preload/index.js
src/renderer/src/scripts/others/renderer.js
Implemented external firewall detection for Pennsieve connectivity
  • Created function to check connectivity with Pennsieve's public API
  • Added network checks before Pennsieve account operations
  • Implemented user notification system for network interference
src/renderer/src/scripts/check-firewall/checkFirewall.js
src/renderer/src/scripts/globals.js
Added user interface elements for network issue notifications
  • Created new CSS styles for firewall documentation links
  • Added copy-to-clipboard functionality for documentation URLs
  • Implemented modal dialogs with network troubleshooting information
src/renderer/src/assets/css/buttons.css
src/renderer/src/scripts/check-firewall/checkFirewall.js
Updated version and configuration files
  • Bumped version from 15.2.1-beta to 15.6.0-beta
  • Added detect-firewall branch to CI workflow
package.json
src/pyflask/startup/minimumApiVersion.py
.github/workflows/Build-and-deploy-win.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @aaronm-2112 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The global.serverLive flag is set to false in multiple error handlers but there's no clear logic for setting it back to true. This could lead to the server being permanently marked as down.
  • Consider consolidating the firewall detection and notification logic to avoid showing multiple redundant alerts to users.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/main/index.js Show resolved Hide resolved
src/renderer/src/scripts/others/renderer.js Show resolved Hide resolved
src/preload/index.js Show resolved Hide resolved
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@aaronm-2112 aaronm-2112 merged commit c6eea8c into pre-staging Nov 22, 2024
5 of 12 checks passed
Copy link

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!

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