bitfireAT/ical4android

Ignore invalid properties

rfc2822 opened this issue · 5 comments

With ical4j/ical4j#454, invalid properties can now be ignored. This feature is available since ical4j 3.2.9.

  • Update to ical4j
  • Enable suppressing invalid properties
  • Test whether everything (including the new "ignore invalid properties") works as expected, maybe add a test for some invalid property

However, this fix doesn't solve https://github.com/bitfireAT/davx5/issues/165 since it doesn't handle ParserException. It does handle ParseException, so I'm not sure if this is a typo or intentional:

https://github.com/ical4j/ical4j/blob/b0257526796e83022708deb3eef56189632da5bf/src/main/java/net/fortuna/ical4j/data/DefaultContentHandler.java#L162-L169

I've added a test for this proprty, but it's obviously failing right now:

https://github.com/bitfireAT/ical4android/pull/82/files#diff-4fe2783696bc41be33a9bbb050074a0fe152cbbe6567ce48b2dc13ae893aed03R73-R92

The error thrown by ical4j is:

...
Caused by: net.fortuna.ical4j.data.ParserException: Error at line 10:Invalid GEO string
at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:172)
at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:197)
at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:185)
at at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:91)
... 29 more
Caused by: java.lang.IllegalArgumentException: Invalid GEO string
...

Thanks for testing, can you please report this back to ical4j?

Okay, so looks like the issue has in fact been fixed. We just have to initialize the CalendarBuilder a bit differently. So #82 should be ready to merge.

I've added a little GEO:0 test to see if it's working or not, and it seems to work perfectly.

I'm a bit confused by the strike-through, because the PR tests seems to succeed (and the PR not a draft).

So is this now working and the PR is ready to be reviewed?

Yup, seems to work. Quite strange tbh, it didn't work, I just ran the tests again, but now I can't manage to reproduce the bug, so I guess something was not synced correctly, maybe some miscached dependencies.