https://bugs.kde.org/show_bug.cgi?id=509497
Bug ID: 509497
Summary: Exception in VCardBuilder due to invalid/empty vcard
string
Classification: Applications
Product: kdeconnect
Version First 25.04.2
Reported In:
Platform: Debian stable
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: android-application
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
SUMMARY
I've been trying to determine why I see phone numbers instead of contact names.
I've done all the recommended stuff (e.g. kpeople-vcard, granting phone
permissions), so I looked at the KDE Connection logs from my phone and noticed
an exception around creation of vcards:
Exception in ContactsPlugin's onPacketReceived()
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:2064)
at
org.kde.kdeconnect.Helpers.ContactsHelper$VCardBuilder.<init>(ContactsHelper.java:309)
at
org.kde.kdeconnect.Helpers.ContactsHelper.getVCardsSlow(ContactsHelper.java:158)
at
org.kde.kdeconnect.Helpers.ContactsHelper.getVCardsForContactIDs(ContactsHelper.java:176)
at
org.kde.kdeconnect.Plugins.ContactsPlugin.ContactsPlugin.handleRequestVCardsByUIDs(ContactsPlugin.java:216)
at
org.kde.kdeconnect.Plugins.ContactsPlugin.ContactsPlugin.onPacketReceived(ContactsPlugin.java:255)
at org.kde.kdeconnect.Device.notifyPluginPacketReceived(Device.kt:433)
at org.kde.kdeconnect.Device.onPacketReceived(Device.kt:422)
at
org.kde.kdeconnect.Backends.BaseLink.packetReceived(BaseLink.java:60)
at
org.kde.kdeconnect.Backends.LanBackend.LanLink.receivedNetworkPacket(LanLink.java:256)
at
org.kde.kdeconnect.Backends.LanBackend.LanLink.$r8$lambda$1roQrklD197DaNpVzAP29DenyWc(LanLink.java:90)
at
org.kde.kdeconnect.Backends.LanBackend.LanLink$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:0)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
I didn't bring it up in a debugger, so I'm not sure whether the vcard string
passed into the constructor was empty (my guess), or simply didn't contain an
"END:VCARD":
VCardBuilder(String vcard) {
// Remove the end tag. We will add it back on in .toString()
vcard = vcard.substring(0, vcard.indexOf(VCARD_END));
vcardBody = new StringBuilder(vcard);
}
NOTE: The try/catch is located INSIDE the loop, suggesting that some outlier
among my contacts would only affect that contact and not the entire list. Thus
I suspect that there is some earlier issue preventing the contact information
from reaching this point...
STEPS TO REPRODUCE
1. After connecting my Galaxy Note 10+ phone (LAN/Wi-Fi), I open KDE
Connect SMS. I see a list of conversations, but phone numbers and the generic
contact icon are displayed for each rather than contact information and avatar
images.
OBSERVED RESULT
Conversations appear in a list, but phone numbers are displayed instead of
contact information.
EXPECTED RESULT
Contact avatar images and names should be displayed for each item in the
list.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian GNU/Linux 14 (Trixie)
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are watching all bug changes.