← Back to Pull requests

Fix large Move imports stalling after all photos are imported #1537

Closed
unknown closed this pull request without merging on Dec 04, 2026 02:50 UTC
View on GitHub
unknown unknown commented on Dec 04, 2026 01:04 UTC
Author

Closes #1535.

Motivation

A 16,341-photo Move import left Overlook spinning after the file counter reached its total. The macOS spindump shows synchronous SQLite writes dominating Electron’s main thread. The Move completion handler recorded one Undo command per photo and repeatedly scanned and rewrote discarded history.

Description

Record the batch in the activity transaction. Use the command stack index to check byte usage and prune active records. Discard each old command once, release its retention hold, and redact expired Move paths once per batch. Preserve the 100-command Undo limit, byte admission order, and sensitive path expiry.

On Linux, recording 2,000 synthetic Move history records took 45.8 seconds on 0.79.1 and 0.32 seconds with the fix. The patched history step took 2.3 seconds for 16,341 synthetic records.

Documentation and changeset

The retention and custody rules in ADR-0025 still apply. A patch changeset records the performance fix.

Testing

The signed commit’s tree matches the tree tested locally. The checks below passed.

  • npm run lint and npm run format:check

  • npm run typecheck, npm run test:compile, and npm run test:dom:compile

  • npm run test:run (2,909 unit tests, 149 DOM tests, and the 200K paging benchmark)

  • npm run check:interop-acceptance and npm run docs:gov
  • Manual testing

    On macOS, import a large folder of unique disposable photos in Move mode. Verify the completion summary appears, the photos are visible in the library, and Undo can restore a recently moved source while its lease is valid. Older commands should fall outside the 100-command limit.

    <!-- agent-bot-write: ghw_69f1fb11d74c55f2 session=f601b21bf418 bot=trueline-codex-agent[bot] -->

    Diff: 218 lines (+163 / -55) across 2 files Reviewer: qwts Review duration: 106m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 218 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.322
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1537"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%