Conversation
- Guard AttachmentList against missing extendedData and info properties - Guard CardSidebar currentCard watcher when card is deselected - Safeguard Description editor setup and teardown against unmounted states Signed-off-by: aquananu <AQUANANU@GMAIL.COM>
|
same error exist in Deck version 1.18.5 too |
Signed-off-by: aquananu <93096176+aquananu@users.noreply.github.com>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
This PR resolves multiple client-side reactivity exceptions and unhandled teardown crashes in Nextcloud Deck:
Fix Attachment List Rendering & Null Safety (
src/components/card/AttachmentList.vue):attachment.extendedData?.filesizeandattachment.extendedData?.attachmentCreator?.displayNameto prevent template render errors when attachments lack metadata.attachment?.extendedData?.hasPreviewandattachment?.extendedData?.mimetypeinmimetypeForAttachment.#) inattachmentPreview,attachmentUrl,internalLink, anddownloadLink(attachment?.extendedData?.path).TypeError: Cannot read properties of undefined (reading 'filename')inattachmentBasenameandattachmentExtensionby using optional chaining (attachment?.extendedData?.info?.filename ?? (attachment?.name ?? attachment?.data ?? '').replace(...)).Fix Card Sidebar Watcher Crash on Card Deselection (
src/components/card/CardSidebar.vue):TypeError: Cannot read properties of undefined (reading 'id')in thecurrentCard(newCard, oldCard)watcher when closing a card modal or clearing selection (newCardbecomingnull/undefined). Now safely evaluatesnewCard?.id === oldCard?.idand only invokesfocusHeader()whennewCardis present.Fix Tiptap Rich Text Editor Unmount Teardown and Race Conditions (
src/components/card/Description.vue):this.editor.setContent(...)in thecardwatcher with a method existence check andtry...catchto prevent invocation during disposal.this._isBeingDestroyed || this._isDestroyed) insetupEditor(). If a card modal is closed whileOCA.Text.createEditor(...)is still resolving, the newly created editor is destroyed immediately rather than retained on an unmounted DOM ref.[tiptap error]: The editor view is not available. Cannot access view['dom']indestroyEditor()by immediately nullifyingthis.editorand wrappingeditor.destroy()in atry...catchblock.extendedData.infosafely when formattingfileNameinaddAttachment.TODO
AttachmentList.vue:49-51, 159, 167-176, 196-201)currentCardwatcher in sidebar (CardSidebar.vue:210-214)Descriptionrich text editor setup and teardown against unmounted states (Description.vue:186-192, 208-262, 302-305)stable34, etc.)Checklist
npm run lintpasses with 0 errors)git commit -s)