mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-12 15:26:16 -08:00
fix(thumbnail): [PKG-TOOL-THUMB-04] protect event names and nested once dispatch
This commit is contained in:
1 parent
3bff236145
commit
17befee4b1
19 files changed
+9058
-26
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,39 @@
|
||||
# PKG-TOOL-THUMB-04 emitter behavior checkpoint
|
||||
|
||||
Starts from 3bff236145805ecae46ce60ff5c5710189560755. This closes reproduced event
|
||||
registry defects independently of the pending 3.5.31/4.4.0 default-policy choice.
|
||||
04 remains doing; no default options, extraction timing or public types change.
|
||||
|
||||
## Before and after
|
||||
|
||||
The inherited tiny-emitter structure treats Object.prototype members as event
|
||||
arrays. emit/on/off can fail on names such as __proto__, constructor and toString;
|
||||
inherited getters/setters can intercept a replaced public e registry. Nested emits
|
||||
take separate snapshots, allowing one once wrapper to run in an inner dispatch
|
||||
and then again when the outer snapshot resumes, even after the inner throw was
|
||||
caught. Re-registering its original callback does not make that duplicate correct.
|
||||
|
||||
The candidate checks own keys and creates new entries with data descriptors,
|
||||
retaining the registry object/prototype and ordinary descriptor flags. Each once
|
||||
closure is consumed before removal/callback invocation. Normal listener order,
|
||||
snapshot behavior, callback ctx, symbols/numbers, duplicate independent
|
||||
registrations, original-function removal and synchronous exception identity remain.
|
||||
The design matches the already-tested core approach, without adding a runtime
|
||||
dependency on the core or erasing this tool's declaration-specific tuple boundary.
|
||||
|
||||
Six new Node cases pass 1/fail 5 on the frozen workspace. Candidate source and
|
||||
artifacts repeat them together with the unchanged input/extraction/facade tests.
|
||||
The new real-browser case verifies special names, nested once and native DOM
|
||||
cleanup. Existing extraction, native media controls and Monaco cases are rerun
|
||||
for source/main/legacy because the runtime bundle has changed. Windows WebKit
|
||||
Blob failures remain explicit unavailable controls, not successful extraction.
|
||||
Installed package checks repeat after the final package documentation/build.
|
||||
|
||||
The upstream attribution remains in every bundle and pack. The provenance ledger
|
||||
records these intentional local fixes separately from the previous type-only
|
||||
adaptation. THUMB-EVENT-01 tracks closure evidence; default-policy, historical CSS
|
||||
and actual supported Safari/core integration gates are unaffected.
|
||||
|
||||
Revert this checkpoint to roll back only the emitter fixes and their records;
|
||||
run the normal package build and installed checks again. Keep earlier lifecycle,
|
||||
public declaration and distribution fixes. No push, tag or publication.
|
||||
+1
-1
@@ -538,5 +538,5 @@
|
||||
- PKG-TOOL-THUMB-01: [记录](baselines/thumbnail-release.json) [记录](baselines/thumbnail-contract.md) [记录](changes/2026-09-13-PKG-TOOL-THUMB-01-contract.md) [记录](baselines/thumbnail-contract-validation.json)
|
||||
- PKG-TOOL-THUMB-02: [记录](baselines/thumbnail-behavior-validation.json) [记录](changes/2026-09-13-PKG-TOOL-THUMB-02-behavior.md)
|
||||
- PKG-TOOL-THUMB-03: [记录](changes/2026-09-13-PKG-TOOL-THUMB-03-input-checkpoint.md) [记录](baselines/thumbnail-input-checkpoint.json) [记录](changes/2026-09-13-PKG-TOOL-THUMB-03-lifecycle.md) [记录](baselines/thumbnail-lifecycle-validation.json)
|
||||
- PKG-TOOL-THUMB-04: [记录](changes/2026-09-13-PKG-TOOL-THUMB-04-runtime-types.md) [记录](baselines/thumbnail-runtime-types-validation.json) [记录](changes/2026-09-13-PKG-TOOL-THUMB-04-public-types.md) [记录](baselines/thumbnail-public-types-validation.json)
|
||||
- PKG-TOOL-THUMB-04: [记录](changes/2026-09-13-PKG-TOOL-THUMB-04-runtime-types.md) [记录](baselines/thumbnail-runtime-types-validation.json) [记录](changes/2026-09-13-PKG-TOOL-THUMB-04-public-types.md) [记录](baselines/thumbnail-public-types-validation.json) [记录](changes/2026-09-13-PKG-TOOL-THUMB-04-emitter.md) [记录](baselines/thumbnail-emitter-validation.json)
|
||||
- PKG-FACTORY-01: [记录](baselines/factory-assignment-gaps.json) [记录](baselines/factory-compatibility-proposals.json) [记录](factory-compatibility-decision.md) [记录](changes/2026-09-12-PKG-FACTORY-01-decision.md)
|
||||
@@ -1,5 +1,17 @@
|
||||
# 进度与证据
|
||||
|
||||
## PKG-TOOL-THUMB-04 事件注册表修复检查点(doing)
|
||||
|
||||
复现并修复特殊事件名碰撞对象原型、继承getter/setter干扰,以及嵌套emit导致once重复执行。
|
||||
保留普通派发快照/ctx/off原回调/独立重复注册语义,使用own key/data descriptor及每次
|
||||
注册独立的once消费标记。新6项旧版1通过/5失败;候选源码53、main/legacy各55通过。
|
||||
重新构建并重跑三份真实浏览器各63项,共189项:每份34工具、3输入、17Blob不可用、
|
||||
3原生对照、3Monaco、3事件注册表。没有沿用运行文件改变前的媒体证据。
|
||||
完整CI1664、339生产TS、3导入及实际安装7种模式/52项类型反例通过,关闭THUMB-EVENT-01。
|
||||
默认行为策略问题继续等待用户选择;04不标完成。见[变更](changes/2026-09-13-PKG-TOOL-THUMB-04-emitter.md)
|
||||
与[验证](baselines/thumbnail-emitter-validation.json)。222项:112 done、11 doing、99 todo。
|
||||
|
||||
|
||||
## PKG-TOOL-THUMB-04 公开类型与真实安装检查点(doing)
|
||||
|
||||
补齐class/namespace及d.cts/d.mts,修复root ESM并保留直接CJS构造器,新增legacy类型路径。
|
||||
|
||||
@@ -182,3 +182,4 @@
|
||||
| THUMB-PROVENANCE-01 | resolved / 源码/产物事实 | Thumbnail local emitter attribution and historical distribution completeness remain unverified | PKG-TOOL-THUMB-04, PKG-TOOL-THUMB-06 |
|
||||
| THUMB-MEDIA-01 | open / 已复现 | Windows WebKit native Blob URLs cannot load tested MP4 media despite successful HTTP controls | PKG-TOOL-THUMB-05, PKG-TOOL-THUMB-06 |
|
||||
| VENDOR-09 | resolved / 源码/产物事实 | Thumbnail tiny-emitter 改写来源与最终分发许可 | PKG-TOOL-THUMB-04, PKG-TOOL-THUMB-06 |
|
||||
| THUMB-EVENT-01 | resolved / 已复现 | Thumbnail 原型事件名与嵌套 once 派发缺陷 | PKG-TOOL-THUMB-04 |
|
||||
+30
-4
@@ -3919,12 +3919,14 @@
|
||||
"refactor/baselines/thumbnail-contract.md",
|
||||
"refactor/baselines/thumbnail-release.json",
|
||||
"refactor/scripts/thumbnail-contract.test.mjs",
|
||||
"refactor/baselines/thumbnail-public-types-validation.json"
|
||||
"refactor/baselines/thumbnail-public-types-validation.json",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
],
|
||||
"resolutionEvidence": [
|
||||
"refactor/baselines/thumbnail-public-types-validation.json",
|
||||
"refactor/baselines/thumbnail-vendor/sources.json",
|
||||
"packages/artplayer-tool-thumbnail/THIRD_PARTY_NOTICES"
|
||||
"packages/artplayer-tool-thumbnail/THIRD_PARTY_NOTICES",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
],
|
||||
"resolutionRationale": "Fixed 2.1.0 upstream comparison and local adaptation reviewed; complete MIT notice verified in every standalone bundle and every byte of the actual installed candidate pack. Exact original copied revision and complete historical npm archive remain unknown and are explicitly bounded, not claimed recovered. Historical CSS/paths remain independently open under BASE-DIST-01.",
|
||||
"workspaceState": "Current candidate source/bundle/packed attribution verified; repeat installed artifact verification when release contents change."
|
||||
@@ -3961,7 +3963,8 @@
|
||||
"packages/artplayer-tool-thumbnail/src/emitter.ts",
|
||||
"packages/artplayer-tool-thumbnail/THIRD_PARTY_NOTICES",
|
||||
"test/thumbnail-vendor.test.js",
|
||||
"refactor/baselines/thumbnail-public-types-validation.json"
|
||||
"refactor/baselines/thumbnail-public-types-validation.json",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
],
|
||||
"compatibleResolution": "Preserve original attribution, typed local dispatch compatibility and complete MIT notice in source/package/standalone bundles.",
|
||||
"closureCriteria": "Pinned upstream reference and local adaptation reviewed; all bundle and actual packed distribution notices verified. Do not claim the exact original copied revision or a recovered complete historical archive.",
|
||||
@@ -3969,9 +3972,32 @@
|
||||
"resolutionEvidence": [
|
||||
"refactor/baselines/thumbnail-public-types-validation.json",
|
||||
"refactor/baselines/thumbnail-vendor/sources.json",
|
||||
"packages/artplayer-tool-thumbnail/THIRD_PARTY_NOTICES"
|
||||
"packages/artplayer-tool-thumbnail/THIRD_PARTY_NOTICES",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
],
|
||||
"resolutionRationale": "Fixed 2.1.0 upstream comparison and local adaptation reviewed; complete MIT notice verified in every standalone bundle and every byte of the actual installed candidate pack. Exact original copied revision and complete historical npm archive remain unknown and are explicitly bounded, not claimed recovered. Historical CSS/paths remain independently open under BASE-DIST-01."
|
||||
},
|
||||
{
|
||||
"id": "THUMB-EVENT-01",
|
||||
"title": "Thumbnail 原型事件名与嵌套 once 派发缺陷",
|
||||
"confirmation": "reproduced",
|
||||
"status": "resolved",
|
||||
"owners": [
|
||||
"PKG-TOOL-THUMB-04"
|
||||
],
|
||||
"evidence": [
|
||||
"test/thumbnail-emitter.test.js",
|
||||
"refactor/changes/2026-09-13-PKG-TOOL-THUMB-04-emitter.md",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
],
|
||||
"compatibleResolution": "Use own event keys and preserve registry descriptors/prototype; consume each once registration before removal and invocation across nested snapshots.",
|
||||
"closureCriteria": "Frozen failure/candidate success, ordinary event and lifecycle parity, all runtime formats and actual browser plus installed candidate evidence.",
|
||||
"resolutionEvidence": [
|
||||
"refactor/baselines/thumbnail-emitter-validation.json",
|
||||
"test/thumbnail-emitter.test.js",
|
||||
"test/browser/thumbnail-emitter.spec.js"
|
||||
],
|
||||
"resolutionRationale": "Frozen workspace reproduces five failures. Own-key/data-descriptor registry and once-per-registration consumption pass source/main/legacy, actual browser and installed candidate checks while ordinary snapshot/ctx/off/duplicate behavior remains tested."
|
||||
}
|
||||
]
|
||||
}
|
||||
+3
-1
@@ -3817,7 +3817,9 @@
|
||||
"changes/2026-09-13-PKG-TOOL-THUMB-04-runtime-types.md",
|
||||
"baselines/thumbnail-runtime-types-validation.json",
|
||||
"changes/2026-09-13-PKG-TOOL-THUMB-04-public-types.md",
|
||||
"baselines/thumbnail-public-types-validation.json"
|
||||
"baselines/thumbnail-public-types-validation.json",
|
||||
"changes/2026-09-13-PKG-TOOL-THUMB-04-emitter.md",
|
||||
"baselines/thumbnail-emitter-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1036,7 +1036,7 @@
|
||||
"PKG-TOOL-THUMB-04",
|
||||
"PKG-TOOL-THUMB-06"
|
||||
],
|
||||
"sourceStatus": "Local on/once/emit/off structurally correspond to the fixed tiny-emitter 2.1.0 reference; recovered 3.5.31 declared ^2.1.0. Exact original copied revision is unknown. This migration adds types while preserving the local class and dispatch behavior.",
|
||||
"sourceStatus": "Local on/once/emit/off structurally correspond to the fixed tiny-emitter 2.1.0 reference; recovered 3.5.31 declared ^2.1.0. Exact original copied revision is unknown. This migration adds types while preserving the local class and dispatch behavior. Subsequent reviewed fixes use own event keys/data descriptors and once-per-registration consumption across nested snapshots, preserving ordinary dispatch behavior.",
|
||||
"licenseStatus": "Full pinned upstream MIT notice verified in package, all standalone bundles and actual installed candidate tarball. Repeat on changed release candidates; original copy revision remains unknown.",
|
||||
"upstreamSources": [
|
||||
"https://raw.githubusercontent.com/scottcorgan/tiny-emitter/2.1.0/index.js",
|
||||
@@ -1049,7 +1049,7 @@
|
||||
{
|
||||
"path": "packages/artplayer-tool-thumbnail/src/emitter.ts",
|
||||
"algorithm": "sha256-lf",
|
||||
"sha256": "bd4d5472361edd2e31a6ae1aecce01e310e4086edebe434733d0f5b5eea37a0b"
|
||||
"sha256": "a083e029dd1104912d3e9a0ba23a6dcc160d9ccde6a55be40db74367a647a3cb"
|
||||
}
|
||||
],
|
||||
"reviewEvidence": [
|
||||
@@ -1058,7 +1058,9 @@
|
||||
"test/thumbnail-vendor.test.js",
|
||||
"refactor/changes/2026-09-13-PKG-TOOL-THUMB-04-runtime-types.md",
|
||||
"refactor/changes/2026-09-13-PKG-TOOL-THUMB-04-public-types.md",
|
||||
"refactor/baselines/thumbnail-public-types-validation.json"
|
||||
"refactor/baselines/thumbnail-public-types-validation.json",
|
||||
"refactor/changes/2026-09-13-PKG-TOOL-THUMB-04-emitter.md",
|
||||
"refactor/baselines/thumbnail-emitter-validation.json"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user