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

fix: Resolved the issue of being unable to reset it to empty after using the proxy. #2788

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

IzumiMasaharu
Copy link
Contributor

@IzumiMasaharu IzumiMasaharu commented Feb 17, 2025

Description

Resolved the issue of being unable to reset it to empty after using the proxy.

PR Type

  • Feature
  • Bugfix
  • Hotfix
  • Other (please describe):

Linked Issues

#2786

Additional context

I would like to explain my method to fix the bug below.

  • As I gradually delete the existing content in the Proxy input field in the Setting interface, the proxy option in the ~/Library/Application Support/Follow/db.json file is updated in real time.
  • However, when the content deleted from the Proxy field can no longer be parsed into a valid URL or becomes empty, the proxy in db.json stops updating.
  • Similarly, if the content in the Proxy input field in the Setting interface is directly changed to a string that cannot be parsed as a valid URL, it will not trigger an update to db.json.

Therefore, it can be concluded that the function setProxyConfig handles both the empty string and invalid string inputs in the same way——not to update the db.json file.

To differentiate between these two cases, I chose to modify the return value of the function normalizeProxyUri called within function setProxyConfig. Specifically, when the input is an empty string, I made the function normalizeProxyUri return an empty string. This allows the function setProxyConfig to update the proxy field in db.json to an empty string via store.set.

Note: Since I haven’t set up the related environment on my computer, I hope someone else can help with building it and testing whether my method can actually resolve Issue #2786 without causing any other issues.

Changelog

  • I have updated the changelog/next.md with my changes.

@follow-reviewer-bot
Copy link

Thank you for your contribution. We will review it promptly.

@follow-reviewer-bot
Copy link

@IzumiMasaharu, please use Conventional Commits format for your PR title.

Your PR title should follow this format:
<type>(<scope>): <description>

Common types include:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, missing semi colons, etc)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Changes to build process or auxiliary tools

Examples:

  • feat(user): add user login function
  • fix(api): correct HTTP response status code
  • docs(readme): update installation guide

For more details, please visit: https://www.conventionalcommits.org/

Copy link

vercel bot commented Feb 17, 2025

@IzumiMasaharu is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

@follow-reviewer-bot
Copy link

Suggested PR Title:

fix: return empty string if no user proxy is provided

Change Summary:
Modified the proxy handling to return an empty string when no userProxy is provided, preventing potential unintended behavior in proxy configuration. Updated changelog to reflect this bug fix.

Code Review:
No change requests necessary.

Copy link

Linting and formatting issues were automatically fixed. Please review the changes.

@IzumiMasaharu IzumiMasaharu changed the title A Simple Method to Resolve Issue#2786 fix : Resolved the issue of being unable to reset it to empty after using the proxy. Feb 17, 2025
@IzumiMasaharu IzumiMasaharu changed the title fix : Resolved the issue of being unable to reset it to empty after using the proxy. fix: Resolved the issue of being unable to reset it to empty after using the proxy. Feb 17, 2025
@Innei Innei requested a review from lawvs February 17, 2025 16:00
Copy link
Member

@lawvs lawvs left a comment

Choose a reason for hiding this comment

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

Nice catch!

@Innei Innei merged commit afbea64 into RSSNext:dev Feb 18, 2025
3 of 6 checks passed
@follow-reviewer-bot
Copy link

Thank you @IzumiMasaharu for your contribution! 🎉

Your pull request has been merged and we really appreciate your help in making this project better. We hope to see more contributions from you in the future! 💪

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.

3 participants