[GH-ISSUE #2493] [BUG] DocumentData is duplicating on envelope updates #696

Open
opened 2026-02-26 18:48:05 +03:00 by kerem · 2 comments
Owner

Originally created by @JGGrande on GitHub (Feb 13, 2026).
Original GitHub issue: https://github.com/documenso/documenso/issues/2493

Issue Description

Hello to all project contributors! I recently noticed a behavior in the project and would like to ask a question and, if applicable, report a possible bug.

I'm noticing strange behavior with the DocumentData table and the methods: putNormalizedPdfFileServerSide() and putPdfFileServerSide().

Both functions call the createDocumentData() function, which uploads and creates a new record in the DocumentData table.

All functions work perfectly; the problem is that there are flows that call the put functions when the objective is simply to update the data of an existing document, which generates duplicate records in the table.

There are flows that "compensate" for this behavior and update the "DocumentData"."data" attribute with the data from the most recent document, but even so, the duplicate records remain.

Should I change the flows to call the updateFile() function? Or is this data duplication not a bug but an audit feature?

Steps to Reproduce

  1. Create a new envelope
  2. Finish signing the envelope.
  3. Check DocumenteData table

Expected Behavior

No response

Current Behavior

No response

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

No response

Browser [e.g., Chrome, Firefox]

No response

Version [e.g., 2.0.1]

No response

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @JGGrande on GitHub (Feb 13, 2026). Original GitHub issue: https://github.com/documenso/documenso/issues/2493 ### Issue Description Hello to all project contributors! I recently noticed a behavior in the project and would like to ask a question and, if applicable, report a possible bug. I'm noticing strange behavior with the DocumentData table and the methods: `putNormalizedPdfFileServerSide()` and `putPdfFileServerSide()`. Both functions call the `createDocumentData()` function, which uploads and creates a new record in the DocumentData table. All functions work perfectly; the problem is that there are flows that call the put functions when the objective is simply to update the data of an existing document, which generates duplicate records in the table. There are flows that "compensate" for this behavior and update the `"DocumentData"."data"` attribute with the data from the most recent document, but even so, the duplicate records remain. Should I change the flows to call the `updateFile() `function? Or is this data duplication not a bug but an audit feature? ### Steps to Reproduce 1. Create a new envelope 2. Finish signing the envelope. 3. Check DocumenteData table ### Expected Behavior _No response_ ### Current Behavior _No response_ ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] _No response_ ### Browser [e.g., Chrome, Firefox] _No response_ ### Version [e.g., 2.0.1] _No response_ ### Please check the boxes that apply to this issue report. - [ ] I have searched the existing issues to make sure this is not a duplicate. - [ ] I have provided steps to reproduce the issue. - [ ] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [ ] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2026):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:3897800533 --> @github-actions[bot] commented on GitHub (Feb 13, 2026): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@wang2-lat commented on GitHub (Feb 21, 2026):

看起来 createDocumentData() 在每次信封更新时都会创建新记录而不是复用现有的。建议先检查是否有 documentId 可以传入来更新现有记录,或者在调用前加个查询逻辑判断该文档数据是否已存在。

<!-- gh-comment-id:3939040215 --> @wang2-lat commented on GitHub (Feb 21, 2026): 看起来 `createDocumentData()` 在每次信封更新时都会创建新记录而不是复用现有的。建议先检查是否有 `documentId` 可以传入来更新现有记录,或者在调用前加个查询逻辑判断该文档数据是否已存在。
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#696
No description provided.