Repository navigation
fix: Stabilize PDF preview cell lifecycle - #2068
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The unreproduced production crash depends on UIKit/PDFKit callback timing, so confirming that deferred activation prevents re-entry requires device lifecycle/stress testing and beta crash monitoring beyond static review.
No open issues 🎉
What changed in this PR
Stabilizes PDF preview cell lifecycle handling by deferring PDFKit activation until display and preventing stale callbacks from updating navigation. The suspected production crash still requires device validation and beta monitoring.
Changes:
- Defer document activation and cancel pending work when cells leave display or are reused.
- Pass file identity and page counts directly to the preview controller.
- Add regression tests for activation, reuse cancellation, page counts, and stale callbacks.
| File | Description |
|---|---|
| kDriveTests/kDrive/UTPdfPreviewCollectionViewCell.swift | Adds PDF lifecycle and callback regression coverage. |
| kDrive/UI/View/Files/Preview/PdfPreviewCollectionViewCell.swift | Defers activation, cancels pending work, and guards page updates. |
| kDrive/UI/Controller/Files/Preview/PreviewViewController.swift | Receives page updates directly and checks the current file. |
Review effort: Balanced
adrien-coye
force-pushed
the
fix/preview-kaput
branch
from
November 4, 2026 08:25
e502793 to
71fb016
Compare
adrien-coye
marked this pull request as ready for review
November 4, 2026 08:27
adrien-coye
force-pushed
the
fix/preview-kaput
branch
from
November 4, 2026 13:20
98a3bf7 to
23f2092
Compare
adrien-coye
force-pushed
the
fix/preview-kaput
branch
from
November 5, 2026 15:24
d5e6859 to
3bf0392
Compare
adrien-coye
enabled auto-merge
November 5, 2026 15:24
Muuushuuu
approved these changes
Nov 5, 2026
adrien-coye
disabled auto-merge
November 5, 2026 20:57
adrien-coye
enabled auto-merge
November 5, 2026 20:58
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Context
PDFKit document activation during cell provisioning is the leading suspected re-entry path. The exact production crash has not been reproduced locally; device validation and beta monitoring are still needed.