Skip to content

Correct error interpreting vcard timestamp size

Summary

Previously, Android was sending us all kinds of wild "timestamp" values, usually negative numbers, because it was interpreting the timestamp (milliseconds since epoch) as an int instead of a long.

This didn't actually cause any problems because the value was being deterministicly smashed into an int, so when the contact card changed, this value also changed. However, it's still nicer to have the correct thing here.

This patch requires a corresponding Android-side patch in order to fully fix the issue, see https://invent.kde.org/kde/kdeconnect-android/merge_requests/103, but it is safe to merge without merging the Android patch (the behavior will be exactly the same)

Test Plan

Look at a vcard's X-KDECONNECT-TIMESTAMP field

Before:

You most likely see some large-ish, negative number which makes no sense for a timestamp.

After:

You now see some large-ish, positive number. If you convert the timestamp to a date, you should see the date you last modified that contact (though Android seems to "modify" contacts very frequently in the background)

Edited by Simon Redman

Merge request reports

Loading