[中] 打开工程不清理待确认框与选眼撤销记录;旧分析任务仍可能写缓存

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
swift
Domain
desktop

Research direction

Start in Sources/BirdLockApp/AppState.swift, reading openProject/closeProject around lines 1210-1237 and the state declarations at :397 and :664-671 (pendingCustomBox, eyeUndo, cropEdit), then PreviewArea.swift:356 to see how per-frame boxes are rendered. Trace startAnalysis cancellation and scheduleSave to find where the old isCancelled check sits relative to ProxyCache.shared.saveAnalysis(a). Done means stale selections no longer survive a project switch and a cancelled task or outdated snapshot can no longer write the cache; the issue reports a static audit only, so a reproduction is still needed first.

Written by the indexing model from the issue text.

Description

位置:Sources/BirdLockApp/AppState.swift:1210-1237、:397、:664-671;Sources/BirdLockApp/Views/PreviewArea.swift:356

现象:openProject/closeProject 没有清空 pendingCustomBox、eyeUndo(也未清 cropEdit)。旧工程里已框选但未确认的自定义框会在新工程里按帧号显示,帧号相同时甚至会被当作新工程的框。startAnalysis 取消旧任务后,旧任务可能已越过最后的 isCancelled 检查,仍执行 ProxyCache.shared.saveAnalysis(a);scheduleSave 捕获的旧快照也可能晚于新快照落盘。

建议:在 openProject/closeProject 清空这些状态;saveAnalysis 前检查取消标志;scheduleSave 执行前比较 fingerprint/编辑版本。

来源: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.