Read the MIME icon cache buster from initial state before Theming global assignment
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- frontend
调研方向
从 core/src/OC/mimeType.js 中的 getIconUrl 开始,检查如何读取 theming 的缓存破坏参数。使用有效的 theming/data 初始状态和 window.OCA = {} 进行复现,然后验证所描述的 13 个案例,包括别名、已缓存的 URL、清除缓存、更新以及格式错误或缺失的状态;完成标准是所有案例都通过,且不依赖 OCA 命名空间。
由索引模型根据 Issue 内容生成。
描述
Repository: https://github.com/nextcloud/server
core/src/OC/mimeType.js reads window.OCA.Theming.cacheBuster in getIconUrl. This throws when valid theming/data initial state is present but the additional OCA.Theming assignment has not happened or the OCA namespace has been replaced. Recommendations calls this method when initializing RecommendedFile.
The affected source is byte-identical in Nextcloud v33.0.6, v33.0.8 and stable33 revision cf340916779182c899e2e9d5bfebcaff5dfc6058.
Reproduction: provide valid initial state theming/data with {cacheBuster: 73}, normal OC MIME/theme configuration and window.OCA = {}; call getIconUrl('text/plain'). The global property lookup throws even though the needed state exists. The same occurs after replacing OCA or removing it. These reproduce the unsafe dependency; the exact scheduling of the original browser incident was not recorded.
Proposed change:
+import { loadState } from '@nextcloud/initial-state'
...
-path += '?v=' + window.OCA.Theming.cacheBuster
+path += '?v=' + loadState('theming', 'data').cacheBuster
This uses the state object already read by apps/theming/src/theming.ts, including its shared cache identity. There is no default cache-buster and missing or malformed initial state remains an error.
Validation: 13 extracted-source cases, with three failures before and all 13 passing after. Coverage includes MIME aliases, older theme paths, unknown MIME types, cache-buster zero, cached URLs, cache clearing, later updates through the shared state object and malformed/missing state. The matching diagnostic bundle passed the same cases. A local Chromium comparison with this and two independent app corrections passed all navigation checks; a full rebuilt release remains untested.
This is a JavaScript initialization issue, distinct from the server-side AppConfig cache-buster integer/string mismatch reports for Nextcloud 34.
- 主要语言
- PHP
- 星标
- 36.9k
- 派生
- 5.2k
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 735
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud/server 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
0. Needs triage 35-feedback bug feature: external storage
难度 2/5 1-3 小时 新手友好度 75/100
nextcloud/server#64702 · 2 条评论 ·
维护者通常 1 天内回复
-
3. to review
难度 2/5 1-3 小时 新手友好度 78/100
nextcloud/server#64461 · 1 条评论 ·
维护者通常 1 天内回复
-
0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 76/100
nextcloud/server#64019 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
.htaccess whitelist missing .json/.ftl → files_pdfviewer locale 404s, PDF viewer stuck in English未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
Awaiting Triage
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
WordPress/two-factor#1008 ·
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复