[中] 视频提取的临时目录崩溃后残留,缓存清理不会处理

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
desktop

Research direction

Start by reading Sources/BirdLockCore/IO/CachePolicy.swift:42-52, where groups builds the regexes that match 32- and 24-hex cache directory names, and check how totalSize enumerates entries. Then read Sources/BirdLockCore/IO/VideoImporter.swift:90 and :144 to see how .extract-<UUID> and .replaced-<UUID> directories are created and where defer cleans them up. Done means orphaned .extract-*/.replaced-* directories older than a chosen age are removed on the next import (or included in the cleanable groups) and no longer counted in totalSize; reproduce by force-quitting during an import.

Written by the indexing model from the issue text.

Description

位置:Sources/BirdLockCore/IO/VideoImporter.swift:90、:144;Sources/BirdLockCore/IO/CachePolicy.swift:42-52

现象:提取时创建 base/.extract-<UUID>,替换旧缓存时创建 .replaced-<UUID>。正常异常路径靠 defer 删除,但崩溃或强退会留下目录;CachePolicy.groups 只匹配 ^[a-f0-9]{32}$ 与 ^[a-f0-9]{24}$,不会清理这些目录,而 totalSize 会把它们计入缓存占用。

复现:导入视频时强制退出应用,再查看缓存的占用与清理结果。

建议:VideoImporter.extract 开始时清理超过一定时间的 .extract-*/.replaced-*,或把这类目录纳入 CachePolicy 的可清理组。

来源:2026-11-15 全仓只读审计,PR #7 未包含此项。 未在实机复现(静态审计)。

Dominant language
Swift
Stars
2
Forks
2
Avg merge
1h 11m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cyandee/BirdLock

All issues in cyandee/BirdLock

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.