Bug 495526 - Can't rename device, invalid device name
Summary: Can't rename device, invalid device name
Status: CONFIRMED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: unspecified
Platform: Android All
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
: 495579 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-10-29 11:17 UTC by Linus Kardell
Modified: 2025-01-15 14:13 UTC (History)
17 users (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 Linus Kardell 2024-10-29 11:17:32 UTC
SUMMARY
I have KDE Connect 1.32.9 from F-Droid on a Motorola Edge 40 Pro with Android 14. If I go into the settings and try  to change the device name (or even just leave it as it is and press rename) I just get a pop-up saying "invalid device name". Also, the name shown in the app isn't correct, KDE Connect on my PC shows the phone as being named "motorola edge 40 pro", but the device name shown in KDE connect on the phone is "moto g play - 2024".
Comment 1 Todd Crimson 2024-10-30 04:18:45 UTC
I would like to report the exact same bug. I'm using a Pixel 8 Pro. Same behavior. Cannot rename the device on the Android.
Please fix / address. 
Thankyou.
Comment 2 Filip 2024-10-30 14:02:15 UTC
*** Bug 495579 has been marked as a duplicate of this bug. ***
Comment 3 Tux34 2024-10-30 21:01:52 UTC
I'm using a Samsung A12 (android 13), same behavior.
Comment 4 TSF 2024-11-09 12:47:39 UTC
Same issue, invalid device name error when attempting to rename device.
Fairphone4, LineageOS21 (Android 14).

There is also some strange behaviour with Autofill when typing the new device name - with every character typed, the word suggestion is filled in. 
eg:
T
TTe
TTeTes
TTeTesTest

Unsure if it is related, but maybe it helps.
Comment 5 Daniel G 2024-11-16 01:18:02 UTC
Also experiencing the same bug, Samsung XCover 6 Pro (Android 14)
Comment 6 Aqeel Zafar 2024-11-17 10:09:16 UTC
Version: 1.32.9 
Installed from: F-Droid
Device: Samsung Galaxy Tab A9+ 5G (SM-X216B)

Same issue as others, trying to edit device name gives error "Invalid device name". Even if I don't change anything and just press "rename".

Let me know if you need any more info.
Comment 7 future10se 2024-11-19 16:48:52 UTC
TLDR: Problem not present in 1.32.5

Hi, I ran into this problem setting up a new phone, a Samsung Galaxy Z Fold 5 running OneUI 6.1.1 / Android 14. I was installing the latest version 1.32.9 from F-Droid.

Any name I entered, including just accepting the default, would result in "invalid device name." I didn't run into this problem with my older phone, so I uninstalled 1.32.9 and installed two versions back, 1.32.5 from F-Droid. I was able to change the name as usual. This suggests that the problem is in a recent commit.

Afterwards, I updated to 1.32.9 with no issues. The new name stuck, but I haven't tried to change it since.

I was not able to check if the release in-between (1.32.7) also has the same issue. I hope this information is useful.
Comment 8 James Flynn 2024-12-05 14:10:28 UTC
future10se from comment #7)
> TLDR: Problem not present in 1.32.5
> 
> Hi, I ran into this problem setting up a new phone, a Samsung Galaxy Z Fold
> 5 running OneUI 6.1.1 / Android 14. I was installing the latest version
> 1.32.9 from F-Droid.
> 
> Any name I entered, including just accepting the default, would result in
> "invalid device name." I didn't run into this problem with my older phone,
> so I uninstalled 1.32.9 and installed two versions back, 1.32.5 from
> F-Droid. I was able to change the name as usual. This suggests that the
> problem is in a recent commit.
> 
> Afterwards, I updated to 1.32.9 with no issues. The new name stuck, but I
> haven't tried to change it since.
> 
> I was not able to check if the release in-between (1.32.7) also has the same
> issue. I hope this information is useful.

Thank you for this workaround, I uninstalled/downgraded to 1.32.5 (from F-Droid repo) and was able to rename, then updated again.
Comment 9 Aleksey Gavrilov 2024-12-16 19:02:25 UTC
This appears to be due to commit 8cb9a180 [1] "Migrate SettingsFragment to Kotlin"

The original java version aborted device name change if the string was empty:

> if (StringUtils.isBlank(name))

But in the kotlin version, the condition is reversed, device name change fails if the string is *not* empty:

> if (!name.isNullOrBlank())

Indeed, 1.32.7 and 1.32.9 allow you to change device name to the empty string (which predictably breaks app's functionality).

[1] https://invent.kde.org/network/kdeconnect-android/-/commit/8cb9a1809de64c94a577678c7c982398f3ed69eb