-
-
Notifications
You must be signed in to change notification settings - Fork 411
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(discussions): add avatars #3587
Conversation
Niceeee! Could we display this functionality only to beta-testers first? Since it might bring some weird UI changes |
Visit the preview URL for this PR (updated for commit c97ad47): https://onearmy-next--pr3587-feat-discussion-add-7gevp0ga.web.app (expires Wed, 03 Jul 2024 14:42:01 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59 |
@davehakkens, et al. I'm not finished on this branch so doesn't need a review yet. |
well i'm looking anyway 🤓 |
Sorry @davehakkens, I missed this comment yesterday. I think based on the current beta tester wrapper component and approach, a fair amount of extra re-coding would be needed to enable them to evaulate this change on prod. Maybe instead the preview link/branch could be left open for longer to get tested by a broader group before merging? |
da3c114
to
8923f53
Compare
It's not a matter of adding an auth wrapper to only display the avatar to beta-testers? (It should be easy to add this)
|
8923f53
to
3c197aa
Compare
@davehakkens I take all your points. It's more work, because:
So I'll:
|
Ah i see. Thanks for explaining @benfurber |
012c834
to
26d21ab
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3587 +/- ##
========================================
Coverage 68.40% 68.40%
========================================
Files 445 449 +4
Lines 13849 14010 +161
Branches 2479 2499 +20
========================================
+ Hits 9473 9584 +111
- Misses 4333 4383 +50
Partials 43 43 ☔ View full report in Codecov by Sentry. |
2 flaky tests on run #5725 ↗︎
Details:
research/write.spec.ts • 1 flaky test • ci-chrome
howto/read.spec.ts • 1 flaky test • ci-chrome
Review all test suite changes for PR #3587 ↗︎ |
93b11ad
to
bc4abcc
Compare
General remark about what I am seeing in the codebase and this pull request: it seems that it is a common case that something changes about a user, for example image (or location) and then their contributions need to be updated (via My first thought is that it would be less of a headache to only store the id of a user and the content of their comment. And then, when we want to show the avatar (or location) the id is used to lookup the user and then get their current avatar, merging the two together (either on the backend when requesting discussion data or on the frontend.) All this logic about if the image changed could go away. So it would just be that the user can change their avatar as much as they want and only the data in the user collection would change, discussions would not get updated at all. Maybe there is some Firebase limitation/justification or some other good reason. 😄 |
Yes its a common practice for a NoSql database. |
I worked at a company that used Mongodb (which is NoSQL) and they were doing the method I suggested. But on some further research, it is kinda like they were treating NoSQL like SQL (strict validation on fields via Mongoose, using stuff like foreign keys, no duplicate data spread across the database.) But I have found this video series, which uses a very similar example to the usecase here (user submissions and wanting to show profile pictures.) https://youtu.be/v_hR4K4auoQ?list=PLl-K7zZEsYLluG5MCVEzXAQ7ACZBCuZgZ&t=380 (timstamped for convenience) I guess it is a general trend of NoSQL and the approach optimizes reads over edits, which makes sense. As the edits don't happen often. And something something about Firebase billing. Consider my comment resolved. Thanks for the push to learn more @mariojsnunes 😄 |
Thanks @mariojsnunes and @pizzaisdavid. Any more code level comments? |
🎉 This PR is included in version 1.188.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
PR Checklist
PR Type
Description
Add option user profile image to comments (and tidies up various responsive layout stuff).
Screenshots/Videos