Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] 파일 복제 버그 수정 #484

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mooninbeom
Copy link
Collaborator

@mooninbeom mooninbeom commented Mar 9, 2025

close #483

변경 사항

  • 파일 이름 변경시 파일이 복제되는 현상 수정

팀원에게 전달할 사항(Optional)

  • 논문이 열리지 않는 버그를 찾던 중 발견했습니다.
  • 논문 뷰 안에서 파일 이름을 수정하고 저장을 하면 이름이 수정된 파일 + 기존 이름의 파일 이렇게 두개가 생성이 되었습니다.
    • ex) 논문1.pdf -> 논문3.pdf로 이름 수정 후 저장 -> 논문3.pdf으로 파일 이름 변경 and 논문1.pdf 새로 생성
  • 해당 문제가 일어나는 이유는 이름을 변경하는 메소드는 정상적으로 실행이 되지만 마지막에 저장을 하는 부분에서 변경된 사항을 반영받지 못해 기존 이름으로 저장을 진행해서 새로운 파일이 생성되는 것이었습니다.
  • 해당 문제가 논문이 열리지 않는 버그의 주요 원인인지는 파악을 하지 못하겠으나 어느정도 영향이 있다고 파악됩니다!
  • 혹시나 논문 열리지 않는 버그의 트리거를 알게되면 공유 부탁드립니다!
  • 저희 프로젝트가 오류 처리가 많이 미흡하여 사용자가 불편함을 많이 느낀다고 생각합니다!(ex 오류 발생시 단순 print, 사용자가 알지 못함) 그래서 나중에 오류처리를 한번 잡아야 할 듯 합니다

@mooninbeom mooninbeom added Fix 버그 수정이 필요할 때 PR-NeedReview 작업이 완료되고 리뷰가 필요한 PR labels Mar 9, 2025
@mooninbeom mooninbeom self-assigned this Mar 9, 2025
Comment on lines +88 to +90
let newBookmarkData = try! newUrl.bookmarkData(options: .minimalBookmark)
dataToEdit.url = newBookmarkData
PDFSharedData.shared.paperInfo?.url = newBookmarkData
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PDFSharedData에 바뀐 이름을 반영해 저장할 때 사용할 수 있도록 변경함

guard let document = pdfView.document else { return }
guard let pdfURL = document.documentURL else {
guard let pdfURL = PDFSharedData.shared.paperInfo?.url, let url = try? URL(resolvingBookmarkData: pdfURL, bookmarkDataIsStale: &a) else {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pdfView에서 url를 받아와 사용을 했었는데 pdfView에서는 바뀐 url을 반영하지 않아 바뀐 URL을 사용할 수 있게 PDFSharedData에서 받아오도록 변경했습니다

Copy link
Collaborator

@minjung0067 minjung0067 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제발.. 이 문제가 원인이길 바라며..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix 버그 수정이 필요할 때 PR-NeedReview 작업이 완료되고 리뷰가 필요한 PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fix] 논문 이름 수정 버그
2 participants