Skip to content

fix: migrate default NGA backend - #392

Merged
BugenZhao merged 3 commits into
mainfrom
agent/fix-nga-backend-redirect
Jul 14, 2026
Merged

fix: migrate default NGA backend#392
BugenZhao merged 3 commits into
mainfrom
agent/fix-nga-backend-redirect

Conversation

@BugenZhao

Copy link
Copy Markdown
Owner

What changed

  • Change the default NGA backend from nga.178.com to bbs.nga.cn in Rust logic and Swift URL defaults.
  • Migrate persisted empty or legacy https://nga.178.com backend settings to the new default.
  • Update backend picker options to prefer currently working NGA hosts.

Why

nga.178.com now redirects API traffic to bbs.nga.cn. MNGA sends auth through POST form fields, and the redirect path can lose those fields before the request reaches the final host, causing NGA to report 未登录 or request errors.

Validation

  • cargo fmt
  • cargo test -p service request::test::test_normalize_base_url -- --exact
  • cargo test -p service test_topic_list -- --ignored --nocapture
  • cargo clippy

@BugenZhao
BugenZhao marked this pull request as ready for review July 14, 2026 10:32
Copilot AI review requested due to automatic review settings July 14, 2026 10:32
@BugenZhao
BugenZhao merged commit 11932d9 into main Jul 14, 2026
2 checks passed
@BugenZhao
BugenZhao deleted the agent/fix-nga-backend-redirect branch July 14, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates MNGA’s default NGA backend to avoid redirect-related auth loss by switching the default host from nga.178.com to bbs.nga.cn, and migrates stored legacy/empty backend settings to the new default across both the Rust logic module and the Swift app.

Changes:

  • Change Rust logic default DEFAULT_BASE_URL to https://bbs.nga.cn and migrate legacy/empty persisted base URLs during set_request_option.
  • Update Swift URL defaults and backend picker host list, plus migrate persisted legacy/empty backend settings on app startup.
  • Simplify CI tool installation by using jdx/mise-action to provision tuist instead of Homebrew formula installation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
logic/service/src/request.rs Adds legacy/empty base URL normalization and a focused unit test.
logic/service/src/constants.rs Switches Rust logic default backend host to bbs.nga.cn.
app/Shared/Utilities/WhatsNew.swift Bumps “What’s New” entry version to 2.3.1.
app/Shared/Utilities/URLs.swift Updates Swift default backend host and curated host options list.
app/Shared/Storage/PreferencesStorage.swift Migrates stored backend setting when empty or pointing at the legacy host.
app/Project.swift Bumps MARKETING_VERSION to 2.3.1.
.github/workflows/release.yaml Uses mise-action to install tuist instead of Homebrew.
.github/workflows/ios_debug.yaml Uses mise-action to install tuist instead of Homebrew.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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