-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 images in note rich text #6550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request addresses issues with images in note rich text by implementing secure access and improved handling of attachments and note bodies.
- Added
NoteQueryResultGetterHandler
innote-query-result-getter.handler.ts
to process note bodies and secure image access with signed tokens - Modified
AttachmentQueryResultGetterHandler
inattachment-query-result-getter.handler.ts
to useAttachmentWorkspaceEntity
type and add signed payload tofullPath
- Updated
QueryResultGettersFactory
inquery-result-getters.factory.ts
to support note objects with the new handler - Improved security by ensuring only authorized users can access images in notes
- Enhanced rich text functionality, fixing image display issues as shown in the before/after screenshots
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
workspaceId: string, | ||
): Promise<NoteWorkspaceEntity> { | ||
if (!note.id || !note.body) { | ||
return note; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Wrap JSON.parse in a try-catch block to handle potential parsing errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Before
After
Note: Not really happy with this implementation, ideally we should implement some generic logic for RICH_TEXT field type.
Note2: We should update the attachment table for new imported images, this was not done before but I'm creating a ticket for that.