Bug 396051 - Wrong file shared when multiple are sent (only last sent one can be shared)
Summary: Wrong file shared when multiple are sent (only last sent one can be shared)
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: 1.8
Platform: Other Android 6.x
: NOR normal
Target Milestone: ---
Assignee: Erik Duisters
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-01 12:26 UTC by rugk
Modified: 2018-11-06 20:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rugk 2018-07-01 12:26:48 UTC
STR:
1. Send file1.jpg via desktop to Android. (LineageOS 14.1)
2. Send file2.jpg in the same way.
<There are two notifications on Android>
3. Try to share file1.jpf via the first notification. (in the preview in the notification the correct image is shown)

What happens:
Even though you selected the share button of the *older* image, KDEConnect always shares the latest one you've received.

What should happen:
Share the one, where I press the "Share" button.

BTW opening the image with a click on the notification also shows the correct one. Just the "Share" button in the notification is affected by this bug.

Desktop is GNOME with GSConnect here, but as I strongly suspect the receiving party has this bug, I report it here.
Comment 1 Albert Vaca Cintora 2018-11-06 20:50:12 UTC
Git commit b4853508e0453bc70f081f733688da39827bb2a5 by Albert Vaca, on behalf of Erik Duisters.
Committed on 06/11/2018 at 20:49.
Pushed by albertvaka into branch 'master'.

When creating sharePendingIntent use a unique requestCode so a new PendingIntent is created

Summary:
Fixes the situation where when 2 or more files are send to Android clicking the share button
in either of the notifications will always share the last received file.

Test Plan:
Send 2 files to android
Click on the share button of the first received file

The first file is actually used for the share and not the last received file

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16707

M  +1    -2    src/org/kde/kdeconnect/Plugins/SharePlugin/ShareNotification.java

https://commits.kde.org/kdeconnect-android/b4853508e0453bc70f081f733688da39827bb2a5