Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates notification unsubscribe logic (Gets data from Notification table instead of JWT) #45

Merged
merged 9 commits into from
Oct 26, 2023

Conversation

john-tco
Copy link
Contributor

@john-tco john-tco commented Oct 19, 2023

Description

GAP-2152

Reads unsubscribe reference data from the unsubscribe table rather than decoding the JWT.

related prs: cabinetoffice/gap-find-backend#59, cabinetoffice/gap-user-service#135

Type of change

Please check the relevant options.

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes:

  • Unit Test

  • Integration Test (if applicable)

  • End to End Test (if applicable)

Screenshots (if appropriate):

Please attach screenshots of the change if it is a UI change:

Checklist:

  • If I have listed dependencies above, I have ensured that they are present in the target branch.
  • I have performed a self-review of my code.
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the documentation where applicable.
  • I have ran cypress tests and they all pass locally.

@john-tco john-tco marked this pull request as ready for review October 19, 2023 10:33
@john-tco john-tco changed the title Refactor notification unsubscribe logic (JWT -> Notification table) Updates notification unsubscribe logic (Gets data from Notification table instead of JWT) Oct 19, 2023
Comment on lines 36 to 37
await handleUnsubscribe(notificationType, notificationId, emailAddress);
await removeUnsubscribeReference(id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between these calls? Is there a reason they're separate? From their names sounds like handleUnsubscribe does not actually unsubscribe you and we need this additional separate step. If that's the case, would suggest merging the endpoints it calls into one potentially

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleUnsubscribe calls existing endpoints to remove notifications rows, these endpoints are accessed elsewhere in the app and they will in fact unsubscribe you. RemoveUnsubscribeReference is a new endpoint just to cleanup the unsubscribe reference table. We probably could combine these if we think it's significantly better / want to make the existing endpoints more generic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have combined these calls with the lastest commits

@ryan-tco ryan-tco merged commit 257c219 into develop Oct 26, 2023
@john-tco john-tco deleted the feature/GAP-2152-v2-unsub branch October 26, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants