feat(reminders): add multiprofile ID to ReviewReminder #19242
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose / Description
As discussed on Discord, once the upcoming multiprofile system is implemented, we will need to fire review reminder notifications for all profiles, not just the active one. Currently however, once a notification is scheduled by AlarmManagerService and passed to the OS, there is no indication of which profile it is attached to as ReviewReminder does not include profile information. This is a problem because once the notification fires, it will need to open the corresponding collection to check if there are cards due. Without storing some sort of profile ID in ReviewReminder, the notification code will need to open each profile's collection one after the other to find the deck it is looking for.
This small change rectifies this issue by adding a profileID string field to ReviewReminder. The field is a string because most discussion around the profile ID in Discord and in candidate GSoC proposals revolves around using either a UUID or a string name. In the case of a UUID, we cannot use the built-in Java UUID type because it is not Serializable. Hence, it will need to be converted to a string before it is stored in ReviewReminder. In both cases, a string is sufficient.
See #19065 and Discord (#multiprofile) for more context.
Fixes
How Has This Been Tested?
Checklist