-
Notifications
You must be signed in to change notification settings - Fork 57
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
Added parameter for app display name for dynamic rendering in the wallet during web5 connect flow #945
Conversation
🦋 Changeset detectedLatest commit: 5087f2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
TBDocs Report ✅ No errors or warnings @web5/api
@web5/crypto
@web5/crypto-aws-kms
@web5/dids
@web5/credentials
TBDocs Report Updated at 2024-10-04T20:03:57Z |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #945 +/- ##
=======================================
Coverage 93.49% 93.50%
=======================================
Files 117 117
Lines 33456 33468 +12
Branches 2706 2706
=======================================
+ Hits 31281 31293 +12
Misses 2136 2136
Partials 39 39
|
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.
As web5-js is a package intended to be consumed by thousands of developers we can't expect them to appreciate us using their console for our debug messages. It it also unorthodox. If every node_module we had in the project was using our console for their debug messages we wouldn't appreciate that, we should have a similar level of respect for users of a package we're authoring.
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.
Great work, but agree with Tim I don't think we need to include a ton of logging here.
However I do think we should include some optional callbacks in various state of the flow in order to allow a wallet/app to display status changes as things are happening and/or log something themselves when testing the flow.
Good call on keeping console log clean by default. Was hoping to wait until we have a more thought-through logger to use, but added a logger that doesn't log by default, we can iterate over the logger as needed. Happy to separate the logger portion into a separate PR, kept the logs in this PR to show the context why/when they were introduced. Optional callbacks in various state of the flow would be cool, but probably scope for a different PR. |
This ships a Node.js logger into the web5-js bundle in production, which is inappropriate for clients and servers consuming a library. Beyond Node.js we also support browser, react-native, electron and any other platform that runs a Javascript engine. The best way of accomplishing what you want are callbacks like @LiranCohen suggested. Beyond that (and less important) it's worth it to point out that since this is a library rather than a backend service it's inappropriate to have debug lines of code bloating the LOC count. |
@shamilovtim, Imma rip this out into a separate PR since the main goal is go rid of hardcoded app name in the wallet. I will say that I tested the logger works in browser, but taking in your suggestion, I'll just hand-role a few lines for the implementation without depending on an external lib, unless you have one that you want to recommend. The logger interface is there for exactly the purpose of swapping out implementation easily. |
Currently there is no way for the wallet to dynamically display to the end-user a friendly display name when displaying the permission request. This PR introduces an app specified property for this purpose.
Out of scope for this PR, but a few items to consider for the future.
did:web
DID or similar instead of an ephemeral DID, we'd be able to go the extra mile of perhaps matching the display name with the domain name and give user more assurances.Tested against modified react starter and my own wallet.
PS. Kept some logging I added while debugging, happy to remove if preferred.