elementary / elementary/calendar
Deleting default calendar does not change default setting
- Dominant language
- Vala
- Stars
- 136
- Forks
- 42
- Avg merge
- 8h 33m
- Merged PRs (30d)
- 3
Description
### What Happened?
Originally reported in #553.
It's possible to delete the current default calendar. We don't account for that deletion and keep a reference to the newly deleted calendar as the default setting. So the calendar lists still show it by default, and it's possible to complete editing an event with a deleted calendar as the current calendar that the event will be saved into. When you do save the event, Calendar will still close the editor dialog but is unable to save the event.
### Steps to Reproduce
1. Create a new calendar (local is sufficient) and mark it as default.
2. Delete the newly created calendar.
3. Create a new event.
You will now see that the currently selected calendar is the event you just deleted. This is already a symptom of the bug.
You may also save the event, and see that it silently fails to be created. You should also see the debug message I pasted above.
### Expected Behavior
When deleting the default calendar, we should set a new default calendar out of the available ones (if there are any).
I'm not sure how to determine which calendar should be the new default. Any design guidance would be appreciated. (Paging @elementary/ux)
### OS Version
6.x (Odin)
### Software Version
Compiled from git
### Log Output
```shell
When saving an event to the deleted calendar, it prints the following to the debug log. I assume this is the app capturing the error, but this is not propagated to the GUI:
`
** (io.elementary.calendar:22807): CRITICAL **: 17:57:55.197: EventStore.vala:155: No calendar was found, event not added
`
```
### Hardware Info
Dell XPS 13 9370
Contributor guide
Assessment
This issue has not been assessed yet.