-
-
Notifications
You must be signed in to change notification settings - Fork 90
Avoid NPE when missing DTSTART
for recurring events
#1336
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
Avoid NPE when missing DTSTART
for recurring events
#1336
Conversation
Signed-off-by: Arnau Mora <[email protected]>
I've also added a log message so that if we find some data missing we can know what is it all about. If you don't find it necessary we can remove it. |
What would that mean in our case? Do I understand it correctly that
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a test to verify and document correct behaviour?
I've been looking at how to test this properly, and if I am not wrong, that would mean creating a new test class just like Of course we can add it, but is it really worth it? |
I'd say yes definetly - If the test is relevant we should add it and in this case I find it highly relevant to properly understand (#1336 (comment)), clamp and document the newly added behaviour. |
At least we have a specific iCalendar we could test with… it's surely at least worth the try. If it's absolutely too cumbersome we can still cancel it then
Did you already had a look at that? |
Signed-off-by: Arnau Mora <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you are trying to test here.
We should unit test processICalObject
.
Testing for a recurrence with missing DTSTART
should fail when the test is run with the old implementation (because NPE is thrown) and should succeed with the new implementation (the log statement shows).
Furthermore it would be good to have tests documenting/clamping the accompanying behaviour Ricki mentions.
EDIT:
Ah my bad. I think the PR is still work in progress and not ready for review yet @rfc2822
I will set it to draft again.
Signed-off-by: Sunik Kupfer <[email protected]>
DTSTART
of recurring instancesDTSTART
for recurring events
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Added two tests now. The second one checks that, for a recurring vtodo with exception, but missing dtstart:
For the tests to run successfully on CI we will need to install jtxBoard before running tests. Would it be very hard to setup a gradle task which downloads and installs the latest jtxboard version before the tests run? |
Signed-off-by: Sunik Kupfer <[email protected]>
Gradle task for installing jtxBoard automatically not possible yet. For now: Add |
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
There's still a conflict |
Ah, sorry about that. Fixed |
app/src/androidTest/kotlin/at/bitfire/davdroid/sync/JtxSyncManagerTest.kt
Outdated
Show resolved
Hide resolved
…s not installed Signed-off-by: Sunik Kupfer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that it works with the CaptureExceptionsRule
:)
app/src/androidTest/kotlin/at/bitfire/davdroid/sync/JtxSyncManagerTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/kotlin/at/bitfire/davdroid/sync/JtxSyncManagerTest.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Purpose
Fixes #1265 by correctly handling situations where dtstart is null.
Short description
Handled nullability ofDTSTART
of recurring instances by setting the local value to null, which would re-create the local instance.Stop querying VTODO (or VEVENT) recurrence instances with DTSTART, now using their UID and RECURRENCE-ID only.
Checklist