Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: Paired devices should download without asking first #91

Closed
anonymousaga opened this issue Mar 23, 2023 · 11 comments · Fixed by #107
Closed

enhancement: Paired devices should download without asking first #91

anonymousaga opened this issue Mar 23, 2023 · 11 comments · Fixed by #107
Labels

Comments

@anonymousaga
Copy link

anonymousaga commented Mar 23, 2023

When I transfer a file, I get a dialog to accept the file. I was wondering if paired devices could automatically download without this dialog to make it easier.

@schlagmichdoch
Copy link
Owner

Apart from this being a potential security risk, I think web pages need an active user interaction to be able to download anything so at some point the user needs to click somewhere.

As far as I know, if you share files between your own Apple devices or with contacts via AirDrop you also still have to accept the transfer and I will not divert from that behavior.
The UI/UX change that is implemented into PairDrop and that I requested here improved the UX in a way that you only need to accept a request of multiple files once before all files are transferred.

@schlagmichdoch schlagmichdoch added wontfix This will not be worked on UI/UX labels Mar 25, 2023
@anonymousaga
Copy link
Author

In Airdrop, devices on the same account don’t have any confirmation dialog.

@schlagmichdoch
Copy link
Owner

Hm okay, thanks for the info! I will think about it.
Maybe this could be an option after #55 is implemented. Paired devices are own devices only - persistent and without any confirmation dialogs. Public rooms are temporary and behave like everything else right now.

Not sure about that though as pairing devices is by far not as authenticated as the 2-factor password controlled iDevice authentication. This behavior should at least be opt-in only.

@schlagmichdoch schlagmichdoch added to be decided and removed wontfix This will not be worked on labels Mar 25, 2023
@anonymousaga
Copy link
Author

Yes, maybe when pairing there is a button that says "download without confirmation". So if I wanted bidirectional auto-saving with no dialog I would have to click the checkbox on both devices when pairing.

@schlagmichdoch
Copy link
Owner

schlagmichdoch commented Mar 27, 2023

This would need to be possible to get disabled by the user anytime and be off by default.

I would like to have a GUI to remove the paired devices individually anyways.
Probably the "Unpair Devices" Dialog could be enhanced:

  • Alongside the roomSecrets the last known deviceName is saved and updated on every connection

  • The "Unpair Devices" Dialog will become "Edit Paired Devices"

  • A Table of all connected devices is shown like:

    _____________ Edit Paired Devices _____________

    iPhone Linus --- auto accept [_] - unpair
    Coral Goldfish -- auto accept [✓] - unpair
    Black Bear ------ auto accept [_] - unpair

    CLOSE___________________UNPAIR All DEVICES

So if this will be implemented, it would automatically accept transfer requests (and therefore automatically transfer files) but the download will most likely not start automatically on many browsers. However, as the files are already transferred the "download" would be instant on click.

Probably, I would not add this option to the pairing dialog at all to keep it clean (and because it is not possible to implement this for scanning via QR Code without interrupting the user flow). The userflow would then be 1. Pair devices 2. use the settings above once on each device

@schlagmichdoch
Copy link
Owner

@anonymousaga I gave it a try but it was more complex than I thought:
If you open two tabs on the same browser they share the browser internal database so if you pair another device the browser tabs seem to be paired too eventhough they shouldn't. To properly distinguish the two cases I needed to find a way to notify the other browser tabs which peer is on the same browser and filter that case accordingly.

As I added and refactored quite a lot of code it would be great if you could thoroughly test the changes on this instance before I merge this into the master branch and main instance:
https://pairdrop-dev.onrender.com/

  • use Edit Paired Devices Dialog
  • pair new devices
  • open multiple PairDrop tabs on the same browser
  • unpair while connected to remote peer
  • test auto_accept feature
  • test revoking of auto_accept

@anonymousaga
Copy link
Author

All of the features worked as expected for my android phone + mac (android phone is using app, mac with safari)

Interesting phenomena:

  • I must refresh the browser / close-open the android app for the auto-accept preference to be enforced. Which is fine.

  • When 2 browser tabs are opened, both show as teal (paired) on my phone, and both mac tabs show my phone as teal, but each tab shows each other as blue. So each tab acts like its own device. Which I assume is correct.

Great work on this!! Ill likely donate some when you merge it to the main for going through the effort of refactoring the code!

@schlagmichdoch
Copy link
Owner

schlagmichdoch commented May 10, 2023

Thanks for testing so quickly! Glad it works for the most part already!

  • I must refresh the browser / close-open the android app for the auto-accept preference to be enforced. Which is fine.

This should not be the case. The database is updated as soon as the checkmark is changed and so should be the existing peers.
I'll take a look into this tomorrow and try to fix it.

  • When 2 browser tabs are opened, both show as teal (paired) on my phone, and both mac tabs show my phone as teal, but each tab shows each other as blue. So each tab acts like its own device. Which I assume is correct.

Yes, that's intended. I decided to change the behavior to this as this makes it coherent with pairing not being able between two browser tabs:

  • you cannot pair two browser tabs
  • you cannot unpair or set auto_accept for another browser tab
  • each of the browser tabs connects to another device via the pair secret so they must appear teal on the other device

Also, presumably, paired peers will always be shown in up front. When many peers will be shown simultaneously it will just be cleaner when tabs on the same browser are not shown in up front as that is rarely useful.

Ill likely donate some when you merge it to the main

I'd really appreciate it! All donations are used to pay for the server and the domain.

@schlagmichdoch
Copy link
Owner

  • I must refresh the browser / close-open the android app for the auto-accept preference to be enforced. Which is fine.

This is now fixed. Would you please test again? If everything works as expected I will merge this tomorrow

schlagmichdoch added a commit that referenced this issue May 10, 2023
@anonymousaga
Copy link
Author

I just tested it, and it works as expected.

@schlagmichdoch
Copy link
Owner

After some last fixes this is now stable with v1.7.1 and running live at https://pairdrop.net/ 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.