Skip to content

Android clipboard fix #27

Closed
Closed

Description

@jochenkirstaetter

What happened

Duplicate entries for file references - binary and plain text - using Send file feature

Steps to reproduce

Open mobile app, tap on Send file, chose a file, and send it to desktop peer.

Image

Windows version and build

Windows, Linux

Phone model and Android version

Pixel 9a, Android 17

NectarLink versions

v0.1.4

Logs


Activity

  1. thtbee commented on Oct 18, 2026

    @thtbee
    Owner

    Thanks for tracking this down. Here's the cause:

    When the phone receives a single file, NectarLink puts it on the phone's clipboard so it can be pasted right away (Core.kt, setFileUri). A later Send clipboard then reaches the fallback in PhoneClipboard.read, where coerceToText() on a file in Downloads returns the file's raw bytes. So the PC gets the file and a garbled text entry.

    Your PR for this is welcome. The fix only needs to keep coerceToText() away from items that point to a file. The byte sniffing and the "looks binary" check aren't needed after that, and the sniffing opens the file while the window is getting focus, which can stall the UI with a slow storage provider.

  2. thtbee commented on Oct 19, 2026

    @thtbee
    Owner

    Fixed in #31, thanks Jochen. Copying text that also carries a URI keeps the text now, and other URIs aren't turned into raw content any more. It'll be in the next release.

  3. added a commit that references this issue on Oct 19, 2026
    a56bcaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions