Workaround: don't UPDATE eventStatus to null#85
Conversation
57ca597 to
4cc6cac
Compare
null to nulleventStatus to null
There was a problem hiding this comment.
Pull Request Overview
This PR implements a workaround for an Android Calendar Provider bug where updating an event's status to null causes a NullPointerException. The solution introduces logic to detect when this problematic scenario occurs and either skips the status update or rebuilds the entire event.
Key changes:
- Refactored event update logic to detect and handle the problematic status update scenarios
- Added comprehensive test coverage for the workaround behavior
- Improved existing behavior tests to cover additional edge cases
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AndroidRecurringCalendar.kt | Simplified the update logic by removing the rebuild check and delegating workaround handling to AndroidCalendar |
| AndroidCalendar.kt | Added StatusUpdateWorkaround enum and comprehensive logic to handle the eventStatus=null bug with three strategies |
| AndroidCalendarTest.kt | Added unit tests for the new getStatusUpdateWorkaround method covering all scenarios |
| AndroidCalendarProviderBehaviorTest.kt | Enhanced behavior tests to demonstrate the calendar provider bug and verify workaround effectiveness |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Outdated
Show resolved
Hide resolved
298fd0d to
22b3a5c
Compare
22b3a5c to
d67b589
Compare
There was a problem hiding this comment.
Annoying that we need the workaround. Looks good though. They have answered the ticket with a request for more information. apk which shows the bug, video, adb logs ...
Yes I have seen it. Will do that tomorrow from the train. |
eventStatustonull.If an
eventStatusupdate is requested, we1.remove the
eventStatusvalue from the updated values if the value wouldn't change anyway (null→null), or2. otherwise delete/re-build the event.