Conversation
dennis-zyska
left a comment
There was a problem hiding this comment.
Hi, thanks for the fix. There are additional log files in the commit, that should not be on the branch. Please delete and check the .gitignore.
Deleted the files as per PR comments
There was a problem hiding this comment.
Pull request overview
Fixes a frontend crash in the PDF highlights flow by making PDFHighlights resilient to stale/orphaned comment_state entries that reference deleted comments/annotations.
Changes:
- Made
getAnnotationByCommentState(state)returnnullwhen the backing comment/annotation is missing. - Added a guard in the
commentStateswatcher to skip processing when no annotation is found. - Added several runtime log files under
logs/(activity/complete/error snapshots).
Reviewed changes
Copilot reviewed 1 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/annotator/pdfViewer/Highlights.vue | Adds null-safety around resolving annotations from comment_state and guards the watcher path that previously crashed. |
| logs/activity-2026-03-17.log | Adds captured runtime logs (appears to be environment output). |
| logs/activity-2026-03-18.log | Adds captured runtime logs (appears to be environment output). |
| logs/complete-2026-03-17.log | Adds captured runtime logs (appears to be environment output). |
| logs/complete-2026-03-18.log | Adds captured runtime logs (appears to be environment output). |
| logs/error-2026-03-17.log | Adds an empty error log file. |
| logs/error-2026-03-18.log | Adds an empty error log file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Hi @dennis-zyska, |
I investigated the issue and fixed the frontend crash in the PDF highlights flow.
Root cause
PDFHighlights assumed that state.commentId always resolves to a valid comment and directly accessed:
comment.annotationIdThis caused:
Fix implemented (frontend)
In
frontend/src/components/annotator/pdfViewer/Highlights.vue:getAnnotationByCommentState(state)null-safe:Why this works
The component now safely ignores orphaned/stale comment_state references instead of throwing, so deleted collapsed comments no longer crash highlight/watcher updates and PDF rendering remains stable.