Commit 2e43683
authored
Fix duplicate file upload
Currently, we face an issue when a file with the same name is uploaded more than once:
1. It results in a unique key error in the database.
2. If the file is sent to S3, it overwrites the old file.
To resolve this problem, I've implemented a solution where we concatenate the message ID to the filename. This approach ensures uniqueness for each uploaded file, even if users upload files with identical names multiple times in a chat.
This change allows normal users to upload files with the same name multiple times in a chat without encountering errors or unintended file overwrites.1 parent ebbba7b commit 2e43683
File tree
1 file changed
+1
-1
lines changed- src/api/integrations/channel/whatsapp
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1992 | 1992 | | |
1993 | 1993 | | |
1994 | 1994 | | |
1995 | | - | |
| 1995 | + | |
1996 | 1996 | | |
1997 | 1997 | | |
1998 | 1998 | | |
| |||
0 commit comments