-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
Description
As thunderbird allows duplicate filter names this will lead to filter data only being partially restored. There currently is no UID or metadata that can be used to identify filters.
To improve this add:
- Warn of Duplicates During Backup
- Handle Duplicates During Restore
- Warn of Duplicates During Export
Before exporting:
- Check for duplicate filterName values in the filter list.
- Warn the user if duplicates exist and offer to automatically rename them by appending a number (e.g., FilterName, FilterName (1), FilterName (2)).
Implementation Steps:
Detect Duplicates:
- Iterate over the filter list and identify duplicate names.
- Use a Map or dictionary to track counts of each filterName.
Rename Filters:
- For each duplicate, append a number starting from (1) for subsequent occurrences.
User Prompt:
Display a dialog:
- "Duplicate filter names detected. Would you like to rename them automatically to avoid issues?"
Provide options: - Yes: Rename and export.
- No: Export as-is (with a warning that duplicates may cause restoration conflicts).
- When restoring:
Check if a filterName already exists in the current Thunderbird filter list.
For each match: Append a number to the incoming filter’s name to avoid overwriting existing ones.
- the first filter of a matching name will be overwritten (if the user has created new filters of the same name in the meantime, we will likely overwrite the wrong one!). Remember that name.
- additional filters of the same name get a number appended and might overwrite additional instances of same name filters (assuming they might be the matching versions?)
Conclusion: Restoring is really messy and its almost impossible avoiding data loss or duplication