Repository navigation
fix: desktop: What's New popup never appears after updates when changelog.json has no highlights - #60607
fix: desktop: What's New popup never appears after updates when changelog.json has no highlights#60607cxxde wants to merge 6 commits into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
This fixes #60134. I ran the real v2.2.1 release body through loadChangelog() and gave the result to showWhatsNew (2.2.0 → 2.2.1). On the base the feed has highlights: [], the version is marked seen and no dialog opens. With this PR the four highlights come through and the dialog opens. The new unit tests pass and tsc passes in both packages. I did not run the Playwright spec.
Public API: only the /changelog.json content changes, and it stays backwards compatible. v2 releases now get a "Desktop" highlight group, ### sections are included, and highlight media can be missing. Existing desktop clients already treat media as optional.
The main points are in the inline comments:
- Every
### Highlightsbullet is labelled Desktop. - The desktop client has a second copy of the Desktop-section parsing.
- The generator has two near-identical bullet parsers.
- One test's name says the opposite of what it checks.
The change from "mark seen" to "retry next start" when the current release is missing from the feed looks right to me. A feed that lags a release no longer uses up What's New.
Related: #60273
…tes (changelog.json has no highlights) anomalyco#60134 Feature: anomalyco#44 Changelog-Feature: 修复 Desktop 更新后 What's New 弹窗永不出现的问题:changelog.json 生成器只识别旧版 <highlight source> HTML 块和 ## 小节,无法解析 v2 release notes 的 ### Highlights 列表和 ### 产品小节,导致每个版本都输出空 highlights;桌面端又在 highlights 为空时无条件标记版本已见,更新被静默消费。现在 Console feed 生成器同时解析 v1/v2 两种格式,将 v2 的 Highlights 条目作为 Desktop 分组输出,并在无桌面条目时用 Desktop 小节回填;桌面 updater 读取 Desktop sections 作为兜底,且仅当 feed 中确实包含当前版本但无桌面内容时才标记已见——feed 解析失败或不含当前版本时记录告警并留给下次启动,避免坏发布静默吞掉更新。
9fddce8 to
d1f0682
Compare
There was a problem hiding this comment.
The latest commit breaks the desktop updater. The v2.2.1 case I checked last time still opens the dialog. But packages/gui-plugins now fails tsc (TS2322/TS18048 plus unused namesDesktop/highlight/sectionHighlight), and 2 of the 6 tests in src/updater/changelog.test.ts fail. The details are in the inline comment.
The commit also adds 0001-feat-44-desktop-What-s-New-popup-never-appears-after.patch (1,187 lines, a git format-patch of the earlier commit) at the repository root. Please remove it. It also leaves the doc comment of the removed sectionHighlight behind in changelog-feed.ts.
The generator now uses a single bullet parser, and the misnamed test was renamed, so those two threads are resolved. The Desktop labelling of every ### Highlights bullet is still open.
Public API: unchanged from my last review, apart from this desktop regression.
|
Removed unused |
There was a problem hiding this comment.
The root .patch file and the stale doc comment are gone, thanks.
The desktop updater regression from my last review is still there, and the new commit makes it harder to undo. releaseHighlights is still groups.flatMap(group => group.items ?? []), and namesDesktop/highlight are now deleted. In a small test against readFeed:
- a
cligroup's items show up in the Desktop dialog; - flat
{ source: "desktop", title, description }groups are dropped; - items are no longer checked or cleaned up (
readMediais unused now); - a malformed
nullgroup throwsTypeError: undefined is not an object (evaluating 'group.items').showWhatsNewswallows it, so What's New is silently skipped.
In packages/gui-plugins, tsc still fails (TS2322/TS18048 at changelog.ts:94, unused sectionHighlight/readMedia), and 2 of the 6 tests in src/updater/changelog.test.ts still fail. The description says the fallback tests were removed, but the test file is unchanged.
The fix is to restore the fromGroups logic from 9fddce8 (filter by Desktop source, accept flat groups, map through highlight()) and return it directly. Then remove the section fallback leftovers: sectionHighlight, inlineText, the Section schema, and the section-fallback unit and e2e tests.
Public API: unchanged from my earlier review.
packages/gui-plugins/src/updater/changelog.ts:94: WithnamesDesktopandhighlightdeleted, nothing here filters by source or checks items any more. Non-Desktop groups show in the Desktop dialog, flat groups are dropped, and anullgroup throws (group.items). The.catchinshowWhatsNewswallows that error. This line also failstsc(TS2322, TS18048). Please restore the previous body, i.e. Desktop-source groups mapped throughhighlight(), including flat groups, and drop only the section fallback.
There was a problem hiding this comment.
The new push only merges dev; none of the PR's files changed. The desktop updater regression from my last review is still there. releaseHighlights in packages/gui-plugins/src/updater/changelog.ts returns groups.flatMap(group => group.items ?? []), so non-Desktop groups show in the Desktop dialog, flat groups are dropped, items are not checked or cleaned up, and a null group throws (showWhatsNew swallows it, so What's New is silently skipped). tsc still fails in packages/gui-plugins and 2 of the 6 tests in src/updater/changelog.test.ts still fail. My comment on this was closed, but the code hasn't changed. Restoring the Desktop-filtered fromGroups logic from 9fddce8 (with namesDesktop/highlight()) and removing the section-fallback leftovers and their tests would fix it.
Public API: unchanged from my earlier review.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window. Feel free to open a new pull request that follows our guidelines. |
Description
Fixes #60134
The "What's New" popup never appears after desktop app updates.
The original changelog parser only supported legacy
<highlight>HTML blocks and could not parse the new v2 markdown### Highlightssection, resulting in an empty highlights array.Previously, the updater marked the version as seen immediately when highlights were empty, so the notification would never retry on the next app launch.
Changes
<highlight>format and new markdown### Highlightsrelease notesTesting
<highlight>highlight format continues to work as before### Highlightsbullets parse into highlight items correctlytsc typecheckpasses, unit tests passCompatibility / Risks
Backwards compatible. Only the parsed output of
/changelog.jsonis modified. Existing desktop clients treat the optional media field correctly.No breaking public API changes.
Checklist
Related: #60273
Added by the opencode bot (AI-generated).
Related: #60273
Public API: /changelog.json now fills
highlights(source "Desktop") and###sections for v2 releases, and highlightmediais optional (backwards compatible)