The application includes a feature to restore dismissed events. This is controlled by the canBeRestored property in the EventDismissType enum:
val canBeRestored: Boolean
get() = this != AutoDismissedDueToCalendarMove && this != EventMovedUsingApp && this != AutoDismissedDueToRescheduleConfirmationEvents can be dismissed in various ways:
ManuallyDismissedFromNotification- User dismissed from notificationManuallyDismissedFromActivity- User dismissed from within the appAutoDismissedDueToCalendarMove- System detected the event was moved in calendarEventMovedUsingApp- Event was moved using the appAutoDismissedDueToRescheduleConfirmation- Event was dismissed due to rescheduling confirmation
Currently, the last three types are marked as non-restorable, preventing them from being restored by the user.
AutoDismissedDueToRescheduleConfirmation was recently added to the non-restorable list. However, there are cases where these events could potentially be restored, especially if the original event still exists in the device calendar database.
The canBeRestored property appears to be designed for filtering which dismissed events can be shown to users for restoration, but its actual usage in the codebase is minimal.
- Events dismissed due to rescheduling can technically be restored if they still exist in the calendar database
- Restoration works best when done on the same device where the dismissal occurred
- Allowing restoration of rescheduled events might lead to duplicate events (both original and rescheduled versions)
- Users might expect the ability to undo a rescheduling action if they made a mistake
Legitimate reasons for restoring a rescheduled event:
- Accidental or incorrect rescheduling
- User changed their mind about the reschedule
- Rescheduling failed but the event was already dismissed
-
Keep Current Behavior: Events dismissed due to rescheduling confirmation cannot be restored.
- Pros: Cleaner experience, prevents potential duplicates
- Cons: Users cannot undo mistaken rescheduling actions
-
Allow Restoration: Remove
AutoDismissedDueToRescheduleConfirmationfrom the non-restorable list.- Pros: More flexibility for users, allows recovery from mistakes
- Cons: Potential for confusion with duplicate events
Consider the primary use case for the rescheduling confirmation feature:
- If rescheduling is expected to be a definitive action with low error rates, keep it non-restorable
- If users might frequently make mistakes or change their minds about rescheduling, make it restorable
Based on usage patterns and user feedback, the appropriate option can be implemented with a simple code change to the canBeRestored property.
To mark events dismissed due to rescheduling confirmation as restorable:
val canBeRestored: Boolean
get() = this != AutoDismissedDueToCalendarMove && this != EventMovedUsingApp
// AutoDismissedDueToRescheduleConfirmation removed from non-restorable list