Open
Conversation
The endpoint /api/v1.0/documents/{document_id}/content has been renamed
in /api/v1.0/documents/{document_id}/convert. Convert seems more
accurante and the content endpoint will be used for another purpose more
appropriated.
Accessing a document content can take time in a single request when fetching the retieve endpoint. To speed up this part at put less effort on the django workers, we decided to apply the same mechanism already used to access a media. A new route content-auth is added, checking the url used as original url contains a valid uuid the user can access.
We want a dedicated endpoint to update a document content. Previously, updating the content was made on the update action shared with all other document's properties. When the title is updated, the response contains the content, so a call to the s3 storage is made and we don't want this. Isolating the content update will allow us in the next commit to remove the content from the Document serializer.
The content was always loaded in the document reponse. We remove this behavior in order to not make an http call to the s3 storage. To get the document content it is needed now to use the new endpoint dedicated to retrive the document content.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Purpose
The document content was always present in the document response; updating a document's properties always loads the content in the response, and updating the content is mixed with the document properties.
We decided to remove this behavior, to make dedicated endpoints for fetching and updating document content. We reuse the same mechanism used to fetch a document attachment.
This PR is introducing many breaking changes. A new major version of Docs must be released after we implement all this changes.
A solution must be found to fetch the content from an external api, for now it is not possible to retrieve the content from the resource server api.
All the mechanisms to determine whether a user can update a document related to the websocket, is not yet implemented. We have to determine if we still need it or not.
Lot of tests must be made before merging it.
Proposal