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>
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
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)