-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: utilize generics in UserPreferencesService #504
Conversation
@@ -52,6 +52,7 @@ | |||
"@types/multer": "1.4.12", | |||
"@typescript-eslint/eslint-plugin": "6.19.0", | |||
"@vitejs/plugin-react": "4.2.1", | |||
"@vitest/coverage-v8": "1.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added so we can check unit test coverage with vitest. This is a dev dependency
|
0aea657
to
d60387a
Compare
7aafddd
to
fd3a09f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary already goes a bit into the choices made here. From our chats I know you've tried a generics approach before this solution @danielsiemens, do you mind going over that context and some of the challenges you faced? Documenting it for posterity.
Would also be interesting to state some of the alternatives to the current approach we discussed sync yesterday. Just cause there's a lot of ways to accomplish what we want here and besides the localStorage approach the PR doesn't convey the amount of thought and tradeoff analysis we put into it 😅 If possible I'd state a few options and highlight the one we decided to go with! |
data
attribute to UserPreferenceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm thinking of it, will this update require changes in tha platforms implementations once it reaches a new Aquarium version? If yes, then that's technically a breaking change 🥲
This is also a sensitive part of the application, I know we have tests here but usage in the platforms is a bit different. Can we have a feature version released for this and try a POC of it in the platforms just to see how it goes?
We don't usually do proper semver breaking changes in Aquarium currently. Maybe too extreme but would it be worth to duplicate the implementation? Probably not, but just raising the idea.
Either way nice work @danielsiemens and @gmarques-mParticle
I like the idea to duplicate the implementation, so we can have a FF on CDP to validate it in the consumer side |
hey @gmarques-mParticle, both @danielsiemens and I validated the changes in the platforms locally. Discussion is in the slack thread in PR canvas. I'd like your input again here. We have a separate PR in Nancy to perform the changes to the UPS implementation, so IMO with that plus the unit tests that Dan implemented in Nancy, as well as the Test Plan in the PR, we should be good for keeping only a single implementation. The important part that worried me is we were able to verify backwards compatibility is maintained between the implementations, both by unit and manual testing. Given that I'd suggest we do not duplicate... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been tested both in Aquarium but also in the platforms and we are good to go. This will also be thouroughfully tested in the platform PR introducing it.
Maintaining two implementations would have a much higher likelihood of causing bugs when we can verify through unit tests that the legacy cookies are still valid and working. I agree with @tibuurcio that we should not have a duplicate implementation. |
# [1.36.0](v1.35.0...v1.36.0) (2024-11-28) ### Bug Fixes * typography component updates ([#497](#497)) ([d32d390](d32d390)) ### Features * add abSplit icon ([#499](#499)) ([8776f1c](8776f1c)) * add notificationSubscriptions icon ([#505](#505)) ([b4976bc](b4976bc)) * utilize generics in UserPreferencesService ([#504](#504)) ([4838a86](4838a86))
🎉 This PR is included in version 1.36.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
First off, a big BIG thank you to @gmarques-mParticle for his assistance in making this properly generic. You're the man!
UserPreference
withUserPreferencePerScope
optedIn
attribute outright would break existing usage patterns, and we don't want users forced to re-opt in!Testing Plan
+80% coverage on user-preference related files
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)