-
Notifications
You must be signed in to change notification settings - Fork 375
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: r/profile dapp #1983
feat: r/profile dapp #1983
Conversation
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.
Nice work - I left some comments that should be addressed before merging. Please take a look 🙏
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1983 +/- ##
==========================================
- Coverage 55.01% 54.18% -0.83%
==========================================
Files 481 520 +39
Lines 67432 73038 +5606
==========================================
+ Hits 37097 39576 +2479
- Misses 27318 30245 +2927
- Partials 3017 3217 +200 ☔ View full report in Codecov by Sentry. |
It looks good. I believe I made the last batch of reviews. Please update and notify me so I can make the final round of reviews and merge. |
…r, remove unsued const
…address test, adding prefill value
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.
Apologies for the late review 🙏
I love this; I even didn't know that gnoweb can be used this way. Thank you for this example. Code feels clean as well 👍
Hello @kazai777 . Congratulations on merging this PR. We want to use it in dSocial to store the avatar image. Should this be standardized in some way? For example, the string should a base64-encoded png image. Or should it be an HTML |
Hi @jefft0. I'm glad you want to use |
Yes, we will base-64 encode the image. When retrieving the image, how to know if it is a png or jpg image? |
It might be a good idea to add a prefix to the encoded string. Something like |
This is telling me, to invent something. So, I understand the answer as "No, there is no specific recommended way to store the avatar image." |
There's no standard at the moment, but encoding the image in base64 is just what I would have done personaly. But your remark is interesting, because I could add something to add a prefix according to the image format and retrieve it easily, without you needing to create something new. |
The great thing about r/demo/profile is that many Gno.land apps can use it. Maybe a user first adds their avatar from a different app. Now the user joins dSocial and dSocial needs to display their avatar. This nice feature of a common store for user profile info is why I'm asking about standardization. I'll be happy with whatever solution you choose, but I think it should be documented in the code. Either combine the mime type with the base64 encoding, or add a new field AvatarMimeType which is something like "image/png". |
Good. So we agree that there should be a suggested standard for the Avatar image format. What is the next step? Maybe one of these options:
|
I think the third option is a good one. This will allow other developers to give their opinion on the subject and depending on the feedback, I'll fix it with the best way for everyone. |
OK, thanks. I created the issue. #2598 |
Following this [PR](gnolang#181 (comment)) concerning the creation of a realm `profile` I created this realm which allows the creation of profile as well as the associated functions to display the information of a profile with an address or a username. I have some questions concerning this realm: - Currently, if a user modifies his username, his old username is not freed and is therefore no longer available, even if it is no longer in use. Should I free the old username when the user has changed username? - To make it possible to search by username and address, I've created a second avl tree containing both username and address, so that I can find the profile indexed by its address by searching for it by its username. This is the most efficient solution I've found. I'd like to get some feedback on this and know if I should do things differently so that searching by username is more optimized. - Do you have any other suggestions for completing the profile fields, or other interesting features to add? Thanks in advance for your feedback <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> Closes gnolang#181 --------- Co-authored-by: kazai <kazai@777> Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com> Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
Related to this [PR](#1983) and [Manfred's idea](#1983 (comment)), this PR aims at adding possibility to add arbitrary field to profile. I keep the same fields list defined in the struct, they would be served as "standard/base" fields and all other arbitrary fields are considered as "extra". <!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Signed-off-by: Norman Meier <norman@samourai.coop> Co-authored-by: Norman Meier <norman@samourai.coop> Co-authored-by: n0izn0iz <n0izn0iz@users.noreply.github.com>
Following this PR concerning the creation of a realm
profile
I created this realm which allows the creation of profile as well as the associated functions to display the information of a profile with an address or a username. I have some questions concerning this realm:Thanks in advance for your feedback
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the descriptionCloses #181