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

Calender import of all day events fails with 'Invalid int: "T0"' #78

Open
Joe4Git opened this issue Mar 5, 2019 · 0 comments
Open

Calender import of all day events fails with 'Invalid int: "T0"' #78

Joe4Git opened this issue Mar 5, 2019 · 0 comments

Comments

@Joe4Git
Copy link

Joe4Git commented Mar 5, 2019

Hello,

I still have the import failure on all day events in version 2.6
The failing ics can be reduced to the lines below for testing.

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART;VALUE=DATE:20180101
DTEND;VALUE=DATE:20180101
TRANSP:TRANSPARENT
RRULE:FREQ=YEARLY;COUNT=10;BYMONTHDAY=1;BYMONTH=1
LAST-MODIFIED:20170903T082924Z
DTSTAMP:20180919T130104Z
SEQUENCE:0
CATEGORIES:Birthday
CLASS:PUBLIC
SUMMARY:Name
UID:C5BE50732246E7A
END:VEVENT
END:VCALENDAR

The log shows this exception:

03-03 22:00:56.803: E/DatabaseUtils(9941): Writing exception to parcel
03-03 22:00:56.803: E/DatabaseUtils(9941): java.lang.NumberFormatException: Invalid int: "T0"
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at java.lang.Integer.invalidInt(Integer.java:137)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at java.lang.Integer.parse(Integer.java:374)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at java.lang.Integer.parseInt(Integer.java:365)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at java.lang.Integer.parseInt(Integer.java:331)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at com.android.providers.calendar.CalendarProvider2.fixAllDayTime(CalendarProvider2.java:1588)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2202)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:98)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at android.content.ContentProvider$Transport.insert(ContentProvider.java:220)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:156)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at android.os.Binder.execTransact(Binder.java:404)
03-03 22:00:56.803: E/DatabaseUtils(9941): 	at dalvik.system.NativeStart.run(Native Method)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): An exception occurred
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): java.lang.IllegalArgumentException: Invalid int: "T0"
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at android.content.ContentProviderProxy.insert(ContentProviderNative.java:468)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at android.content.ContentResolver.insert(ContentResolver.java:1190)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at org.sufficientlysecure.ical.ProcessVEvent.insertAndLog(Unknown Source)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at org.sufficientlysecure.ical.ProcessVEvent.run(Unknown Source)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
03-03 22:00:56.807: E/ICS_RunnableWithProgress(10095): 	at java.lang.Thread.run(Thread.java:841)

It's a long time ago where I digged into to code to find the "T0". Don't remember if I unterstood fixAllDayTime(). Finally I tried to change the DTSTART and DTEND values corresponding to the ical reference to
'DTSTART:20180101
DTEND:20180101'
and it was working.

I tried to find the error in the ical4j implementation but it fails to parse this lines. So I tried another version:
'DTSTART;VALUE=DATE-TIME:20180101T000000
DTEND;VALUE=DATE-TIME:20180101T235959'
and it works with ical4j and on android with the calender-import

Because I just fetched the master version of ical4j from github, I can not compare how the version you are using is working.
Please try the example above to verify the fixAllDayTime() method.

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

No branches or pull requests

1 participant