[APIView] Review subscription status should use User IDs not brittle emails
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 144
Description
## Problem
APIView stores review subscribers on the review document, but the UI and subscription manager check the current user email with case-sensitive matching. This can make a user appear unsubscribed on a revision/review page even when their email is present in the review's `Subscribers` list, so they may receive subscriber emails without seeing a way to unsubscribe.
There is also a related profile-data case: the SPA computes the switch from `userProfile.email`. If the user's APIView profile email is null, the UI cannot recognize that the review-level subscriber list contains that user.
## Validation
Current code paths appear to confirm this:
- `ClientSPA/src/app/_components/review-page-options/review-page-options.component.ts` uses `review.subscribers.includes(userProfile.email)`, which is case-sensitive.
- `APIViewWeb/Helpers/PageModelHelpers.cs` uses `subscribers.Contains(email)`, which is case-sensitive for the default `HashSet` comparer.
- `APIViewWeb/Managers/NotificationManager.cs` uses case-sensitive `Contains` / `Remove` when subscribing and unsubscribing.
- `ClientSPA/src/app/_components/review-page/review-page.component.ts` loads the current profile through `UserProfileService.getUserProfile()`, and the profile endpoint returns the stored profile email.
## Expected behavior
If a user is subscribed at the review level, any revision/review page should show them as subscribed and allow them to unsubscribe. Email comparison should be case-insensitive, and the UI/backend should handle existing stored subscriber values whose casing differs from the current user's profile/claim email.
## Notes
This does not appear to be a separate revision-level subscription. The disconnect appears to be review-level subscriber state being checked with exact email casing and, in some cases, against a null profile email.
Contributor guide
Assessment
This issue has not been assessed yet.