feat: route update checks to Nexus and refine updates page#259
feat: route update checks to Nexus and refine updates page#259TalexDreamSoul merged 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughThis PR modifies the update system to source releases from Official Nexus instead of GitHub and adds a news filtering UI that separates release announcements from general updates. The update sourcing logic is simplified to remove GitHub fallback for official sources, while the UI introduces tabbed filtering for different news categories. ChangesUpdate Sourcing and Display Refinement
Documentation Updates
Sequence DiagramsequenceDiagram
actor User
participant UpdatesUI as Updates Page
participant UpdateService
participant NexusServer as Nexus Server
User->>UpdatesUI: Load updates page
UpdatesUI->>UpdateService: fetchLatestRelease (source: OFFICIAL)
UpdateService->>NexusServer: Request from Nexus Releases (getTuffBaseUrl)
NexusServer-->>UpdateService: Return releases + announcements
UpdateService-->>UpdatesUI: Update data (releaseUpdates, announcementUpdates)
UpdatesUI->>UpdatesUI: Split into activeNewsList (release tab default)
UpdatesUI-->>User: Display release news
User->>UpdatesUI: Click announcements tab
UpdatesUI->>UpdatesUI: Set selectedNewsTab = 'announcement'
UpdatesUI->>UpdatesUI: Update activeNewsList = announcementUpdates
UpdatesUI-->>User: Display announcement news
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/core-app/src/main/modules/update/UpdateService.ts`:
- Around line 1418-1420: The OFFICIAL branch currently calls
fetchLatestReleaseFromOfficial directly and lacks retry/backoff; implement a
wrapper method (e.g., fetchLatestReleaseFromOfficialWithRetry) that loops up to
Math.max(1, this.settings.maxRetries || 1) attempts, calls
fetchLatestReleaseFromOfficial(channel, options) inside try/catch, on catch
record lastError, break if !this.isRetryableError(error) or on final attempt,
otherwise await this.sleep(this.calculateRetryDelay(attempt, baseDelay)) where
baseDelay = this.settings.retryDelay || 2000, and finally throw lastError (or
new Error("Failed to fetch official release") if non-Error); then replace the
direct return in the OFFICIAL branch to return
this.fetchLatestReleaseFromOfficialWithRetry(channel, options).
In `@docs/plan-prd/01-project/CHANGES.md`:
- Around line 6-14: The CHANGES.md header metadata still shows "更新时间:
2026-05-04" and a retained window ending at 2026-05-04 which now conflicts with
the new 2026-05-06 changelog entry; open docs/plan-prd/01-project/CHANGES.md and
update the top metadata timestamp and any "保留窗口"/end-date fields to 2026-05-06
(or a matching date range), so the header aligns with the new section; ensure
the file-level date is consistent with the new section referencing
apps/core-app/src/main/modules/update/UpdateService.ts and
apps/nexus/app/pages/updates.vue.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f0bf2e96-b8e3-4b31-9a01-072efaa0cb13
📒 Files selected for processing (3)
apps/core-app/src/main/modules/update/UpdateService.tsapps/nexus/app/pages/updates.vuedocs/plan-prd/01-project/CHANGES.md
| if (this.settings.source?.type === UpdateProviderType.OFFICIAL) { | ||
| try { | ||
| const officialResult = await this.fetchLatestReleaseFromOfficial(channel, options) | ||
| if (officialResult.result.hasUpdate || !officialResult.result.error) { | ||
| return officialResult | ||
| } | ||
| } catch (error) { | ||
| updateLog.warn('Official update source failed, falling back to GitHub', { error }) | ||
| } | ||
| return this.fetchLatestReleaseFromGitHub(channel, options) | ||
| return this.fetchLatestReleaseFromOfficial(channel, options) | ||
| } |
There was a problem hiding this comment.
Restore retry/backoff resilience for the OFFICIAL path.
Now that OFFICIAL is routed directly, transient upstream failures no longer get retry behavior parity with the GitHub path, which can cause avoidable “no update” outcomes on cold cache clients.
Proposed fix
private async fetchLatestRelease(
channel: AppPreviewChannel,
options?: { force?: boolean }
): Promise<UpdateFetchResult> {
if (this.settings.source?.type === UpdateProviderType.OFFICIAL) {
- return this.fetchLatestReleaseFromOfficial(channel, options)
+ return this.fetchLatestReleaseFromOfficialWithRetry(channel, options)
}
return this.fetchLatestReleaseFromGitHub(channel, options)
}private async fetchLatestReleaseFromOfficialWithRetry(
channel: AppPreviewChannel,
options?: { force?: boolean }
): Promise<UpdateFetchResult> {
const maxRetries = Math.max(1, this.settings.maxRetries || 1)
const baseDelay = this.settings.retryDelay || 2000
let lastError: unknown
for (let attempt = 0; attempt < maxRetries; attempt += 1) {
try {
return await this.fetchLatestReleaseFromOfficial(channel, options)
} catch (error) {
lastError = error
if (!this.isRetryableError(error) || attempt >= maxRetries - 1) break
await this.sleep(this.calculateRetryDelay(attempt, baseDelay))
}
}
throw lastError instanceof Error ? lastError : new Error("Failed to fetch official release")
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/core-app/src/main/modules/update/UpdateService.ts` around lines 1418 -
1420, The OFFICIAL branch currently calls fetchLatestReleaseFromOfficial
directly and lacks retry/backoff; implement a wrapper method (e.g.,
fetchLatestReleaseFromOfficialWithRetry) that loops up to Math.max(1,
this.settings.maxRetries || 1) attempts, calls
fetchLatestReleaseFromOfficial(channel, options) inside try/catch, on catch
record lastError, break if !this.isRetryableError(error) or on final attempt,
otherwise await this.sleep(this.calculateRetryDelay(attempt, baseDelay)) where
baseDelay = this.settings.retryDelay || 2000, and finally throw lastError (or
new Error("Failed to fetch official release") if non-Error); then replace the
direct return in the OFFICIAL branch to return
this.fetchLatestReleaseFromOfficialWithRetry(channel, options).
| ## 2026-05-06 | ||
|
|
||
| ### feat(core-app/nexus): 更新检查统一走 Nexus 与 updates 信息架构调整 | ||
|
|
||
| - `apps/core-app/src/main/modules/update/UpdateService.ts` | ||
| - `apps/nexus/app/pages/updates.vue` | ||
| - UpdateService 默认 source 从 GitHub Releases 切换为 Nexus Official(`getTuffBaseUrl()`),且官方源检查失败时不再回落到 GitHub,后续版本监测统一请求 Nexus。 | ||
| - Nexus `updates` 页面将版本 channel 选择上移至要闻区之前;要闻区新增“更新 / 公告”tabs,公告改为单独分栏展示,并统一使用 `TxButton` 交互样式保持按钮规范一致。 | ||
|
|
There was a problem hiding this comment.
Update the changelog header metadata to match the new entry date.
After adding the 2026-05-06 section, the top metadata still says 更新时间: 2026-05-04 and the retained window ends at 2026-05-04, which now conflicts with this update and can mislead readers.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plan-prd/01-project/CHANGES.md` around lines 6 - 14, The CHANGES.md
header metadata still shows "更新时间: 2026-05-04" and a retained window ending at
2026-05-04 which now conflicts with the new 2026-05-06 changelog entry; open
docs/plan-prd/01-project/CHANGES.md and update the top metadata timestamp and
any "保留窗口"/end-date fields to 2026-05-06 (or a matching date range), so the
header aligns with the new section; ensure the file-level date is consistent
with the new section referencing
apps/core-app/src/main/modules/update/UpdateService.ts and
apps/nexus/app/pages/updates.vue.
Motivation
updates页面信息架构,使“版本更新”优先可见并把“公告”独立成 tab,提升内容可读性与运营灵活性。TxButton风格一致,减少视觉/交互差异。Description
getTuffBaseUrl()),并在UpdateService.fetchLatestRelease中当source.type === UpdateProviderType.OFFICIAL时直接调用fetchLatestReleaseFromOfficial,不再回落到 GitHub;变更文件为apps/core-app/src/main/modules/update/UpdateService.ts。apps/nexus/app/pages/updates.vue中将版本 channel 选择器上移到要闻区之前,新增release/announcement的 tabs(通过selectedNewsTab、activeNewsList等computed实现),并把公告列表改为独立 tab 渲染,循环列表从updateList改为activeNewsList。TxButton,并新增样式类news-tab-btn/news-tab-btn--active以匹配标准按钮视觉语言;同时对相关 DOM 结构做适配(移位、样式调整与动画时机微调)。docs/plan-prd/01-project/CHANGES.md,记录此次行为与页面结构调整。Testing
pnpm -C "apps/nexus" exec eslint "app/pages/updates.vue",检查通过。pnpm -C "apps/core-app" exec eslint "src/main/modules/update/UpdateService.ts",检查通过。lint-staged钩子(包含上述 eslint --fix 任务)已执行并通过。Codex Task
Summary by CodeRabbit
Release Notes
New Features
Improvements