[PR #1196] [CLOSED] fix: refetch documents once uploaded #1463

Closed
opened 2026-02-26 19:33:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1196
Author: @emmpaz
Created: 6/25/2024
Status: Closed

Base: mainHead: fix/1192-refetch-document-once-uploaded


📝 Commits (5)

  • fc7e11c fix: limit displayed is now consistent after deleting/creating
  • a7ed768 Merge branch 'documenso:main' into fix/doc-1192-limits-syncing-issue
  • 2bd3606 fix: updating aysnc behavior to align with current behavior
  • 89d6d29 fix: refetch documents after upload
  • 2230c36 Merge branch 'documenso:main' into fix/1192-refetch-document-once-uploaded

📊 Changes

4 files changed (+36 additions, -6 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx (+3 -0)
📝 apps/web/src/app/(dashboard)/documents/documents-page-view.tsx (+7 -1)
📝 apps/web/src/app/(dashboard)/documents/upload-document.tsx (+10 -2)
📝 packages/ee/server-only/limits/provider/client.tsx (+16 -3)

📄 Description


name: Pull Request
about: Submit changes to the project for review and inclusion

Description

Create new server action in documents-page-view.tsx to refetch the documents and pass it the uploading document client component.

When a user uploads a document and does not complete the document (returns to the /documents page), the document does not show the newly uploaded (draft) document because the page is cached.

To fix this issue, we needed a way to invalidate the data. The implementation consists of revalidated the path currently on when uploading to refetch the data (refetchOnUploadSuccess()). We can call this function from the <UploadDocument/> once the upload is successful.

Fixes #1192

Changes Made

Create new server action that revalidates current path and call once uploading a document is successful.

  • Change 1
    Add a function in documents-page-view.tsx
  • Change 2
    Add function to UploadDocumentProps

Testing Performed

Tested by uploading new document, drafting it and seeing if the document is shown in the documents table.

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

Summary by CodeRabbit

  • New Features

    • Added automatic document list refresh after upload and deletion to ensure users see the most up-to-date documents and limits.
  • Enhancements

    • Improved upload and delete document workflows by integrating limit refresh functionality to maintain accurate quota information.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1196 **Author:** [@emmpaz](https://github.com/emmpaz) **Created:** 6/25/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/1192-refetch-document-once-uploaded` --- ### 📝 Commits (5) - [`fc7e11c`](https://github.com/documenso/documenso/commit/fc7e11cd954e32ab7055c21927d3d8a5525a6ef8) fix: limit displayed is now consistent after deleting/creating - [`a7ed768`](https://github.com/documenso/documenso/commit/a7ed768e7a04156aa34b21ca774f26c273fefeb6) Merge branch 'documenso:main' into fix/doc-1192-limits-syncing-issue - [`2bd3606`](https://github.com/documenso/documenso/commit/2bd360653f0a832ff4ce90b666ef4d683f4d1f12) fix: updating aysnc behavior to align with current behavior - [`89d6d29`](https://github.com/documenso/documenso/commit/89d6d29fb37b27e23290fee1658b9cbef2eb1ef0) fix: refetch documents after upload - [`2230c36`](https://github.com/documenso/documenso/commit/2230c36dd6559d75cea4864ecd8aaabe3f19b9ca) Merge branch 'documenso:main' into fix/1192-refetch-document-once-uploaded ### 📊 Changes **4 files changed** (+36 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx` (+3 -0) 📝 `apps/web/src/app/(dashboard)/documents/documents-page-view.tsx` (+7 -1) 📝 `apps/web/src/app/(dashboard)/documents/upload-document.tsx` (+10 -2) 📝 `packages/ee/server-only/limits/provider/client.tsx` (+16 -3) </details> ### 📄 Description --- name: Pull Request about: Submit changes to the project for review and inclusion --- ## Description <!--- Describe the changes introduced by this pull request. --> Create new server action in ```documents-page-view.tsx``` to refetch the documents and pass it the uploading document client component. <!--- Explain what problem it solves or what feature/fix it adds. --> When a user uploads a document and does not complete the document (returns to the ```/documents``` page), the document does not show the newly uploaded (draft) document because the page is cached. To fix this issue, we needed a way to invalidate the data. The implementation consists of revalidated the path currently on when uploading to refetch the data (```refetchOnUploadSuccess()```). We can call this function from the ```<UploadDocument/>``` once the upload is successful. ## Related Issue <!--- If this pull request is related to a specific issue, reference it here using #issue_number. --> <!--- For example, "Fixes #123" or "Addresses #456". --> Fixes #1192 ## Changes Made <!--- Provide a summary of the changes made in this pull request. --> Create new server action that revalidates current path and call once uploading a document is successful. <!--- Include any relevant technical details or architecture changes. --> - Change 1 Add a function in ```documents-page-view.tsx``` - Change 2 Add function to ```UploadDocumentProps``` ## Testing Performed <!--- Describe the testing that you have performed to validate these changes. --> <!--- Include information about test cases, testing environments, and results. --> Tested by uploading new document, drafting it and seeing if the document is shown in the documents table. ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [x] I have tested these changes locally and they work as expected. - [x] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes <!--- Provide any additional context or notes for the reviewers. --> <!--- This might include details about design decisions, potential concerns, or anything else relevant. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added automatic document list refresh after upload and deletion to ensure users see the most up-to-date documents and limits. - **Enhancements** - Improved upload and delete document workflows by integrating limit refresh functionality to maintain accurate quota information. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1463
No description provided.