oxen-io / session-desktop

Session Desktop - Onion routing based messenger
https://getsession.org
GNU General Public License v3.0
1.48k stars 190 forks source link

[BUG] [Regression in 1.11.1] Cannot download attachments - Uncaught TypeError: Cannot read properties of undefined (reading 'path') #2890

Closed RubenGarcia closed 11 months ago

RubenGarcia commented 11 months ago

Code of conduct

Self-training on how to write a bug report

Is there an existing issue for this?

Current Behavior

I compiled current clearnet (commit 0c611170b2b53cd2ca08040083bf5451f3ea3c36) following the instructions in the CONTRIBUTING file.

yarn build-everything
yarn start-prod

I then right-clicked on a message with an attachment and selected "download attachment". The console gave me

Uncaught TypeError: Cannot read properties of undefined (reading 'path')

and the right-click window with the 3 options "download attachment", "copy message", "respond to message" disappeared.

Expected Behavior

I expected a new window with a file browser to appear and allow me to save the file to disk.

Steps To Reproduce

Environment: Ubuntu 22.04.3 LTS, git commit 0c611170b2b53cd2ca08040083bf5451f3ea3c36 Compile and run session. Try to download an attachment.

Desktop Version

commit 0c611170b2b53cd2ca08040083bf5451f3ea3c36

Anything else?

Linux, Ubuntu 22.04.3 LTS commit 0c611170b2b53cd2ca08040083bf5451f3ea3c3

RubenGarcia commented 11 months ago

The latest published appImage does not have the issue, and files can be saved with no problems.

RubenGarcia commented 11 months ago

Trace:

at session-desktop/ts/components/conversation/message/message-content/MessageContextMenu.js:89:52
    at onClick (Item.tsx:140:12)
    at Object.Rb (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:52:317)
    at Xb (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:52:471)
    at Yb (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:53:35)
    at Ze (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:100:68)
    at se (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:101:380)
    at session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:113:65
    at Jb (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:292:189)
    at Nb (session-desktop/node_modules/react-dom/cjs/react-dom.production.min.js:50:57)
RubenGarcia commented 11 months ago

Line of error let targetAttachmentIndex = e.triggerEvent.path[1].getAttribute('data-attachmentindex');

RubenGarcia commented 11 months ago

Line 117 in MessageContextMenu.tsx

RubenGarcia commented 11 months ago

I just noticed that the bug is now present on session-desktop-linux-x86_64-1.11.1.AppImage and it was not present on session-desktop-linux-x86_64-1.11.0.AppImage Please consider reverting.

RubenGarcia commented 11 months ago

I tested today's git

commit 4cd4193b6bb6e2f5e609ac21eb969b4ce865316a (HEAD -> clearnet, origin/clearnet, origin/HEAD)
Author: Audric Ackermann <audric@loki.network>
Date:   Mon Sep 4 10:50:56 2023 +1000

The same issue still exists.

RubenGarcia commented 11 months ago

Verified working in latest git commit ef848d285123b410cffdda2346f3c056a94fd9dd (HEAD -> clearnet, origin/clearnet, origin/HEAD) Merge: c3c2d65e6 fbbb67ea4 Author: Audric Ackermann audric@loki.network Date: Thu Sep 7 11:10:04 2023 +1000 Closing