-
Notifications
You must be signed in to change notification settings - Fork 221
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: update+notifications for console wallet #3284
feat: update+notifications for console wallet #3284
Conversation
c5364b4
to
868c249
Compare
Testing |
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.
Looks good (utAck) - few clippys
applications/tari_console_wallet/src/ui/components/component.rs
Outdated
Show resolved
Hide resolved
applications/tari_console_wallet/src/ui/state/wallet_event_monitor.rs
Outdated
Show resolved
Hide resolved
39e6fc0
to
939e15f
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.
Happy in general, left a few minor comments, I also created some TXT records to test with and saw an available update in the logs, but it did not get written to the notification screen - presumably because I didn't do the whole signature verification part.
2021-09-02 11:00:53.817714000 [p2p::auto_update::dns] [Thread:123145565605888] DEBUG Checking [redacted] for updates...
2021-09-02 11:00:53.817700000 [p2p::auto_update::dns] [Thread:123145565605888] DEBUG Checking [redacted] for updates...
2021-09-02 11:00:53.825693000 [p2p::auto_update::dns] [Thread:123145552949248] DEBUG Update found! app = Tari Console Wallet, arch = macos-x86_64, version = 99.8.12, hash = 6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a
2021-09-02 11:00:53.825740000 [p2p::auto_update] [Thread:123145552949248] DEBUG New unverified update found (app = Tari Console Wallet, arch = macos-x86_64, version = 99.8.12, hash = 6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a). Verifying...
2021-09-02 11:00:53.825721000 [p2p::auto_update::dns] [Thread:123145552949248] DEBUG Update found! app = Tari Console Wallet, arch = macos-x86_64, version = 99.8.12, hash = 6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a
2021-09-02 11:00:53.825753000 [p2p::auto_update] [Thread:123145552949248] DEBUG New unverified update found (app = Tari Console Wallet, arch = macos-x86_64, version = 99.8.12, hash = 6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a). Verifying...
applications/tari_console_wallet/src/ui/state/wallet_event_monitor.rs
Outdated
Show resolved
Hide resolved
applications/tari_console_wallet/src/ui/components/notification_tab.rs
Outdated
Show resolved
Hide resolved
|
||
fn draw_notifications<B>(&mut self, f: &mut Frame<B>, area: Rect, app_state: &AppState) | ||
where B: Backend { | ||
let block = Block::default().borders(Borders::ALL).title(Span::styled( |
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.
Minor: I think it would be good to have some kind of explanation above the block but that could be added later if we implement notifications for other things too
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.
I've added some explanation at the top of the file. So that everyone can easily see the proper file where the add_notification is called. Let me know if you think it's ok, or should change it.
I also added some TODOs (from top of my head) that we can implement in the future. If you have any ideas for other TODOs let me know, or you can create PR after this one.
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.
Sorry, I meant in the UI above the notifications block, info for the user - but it's not critical
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.
Oh, I see. To me the "notifications" is self-explanatory, but as a programmer I'm biased. But we should definitely be very careful with the message that we added. We can add the explanatory on the top later when will have more types of notification, not just update :-)
@@ -360,6 +361,15 @@ pub async fn init_wallet( | |||
config.base_node_event_channel_size, | |||
); | |||
|
|||
let updater_config = AutoUpdateConfig { | |||
name_server: config.dns_seeds_name_server, | |||
update_uris: config.autoupdate_dns_hosts.clone(), |
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.
Please check that all the config options are noted in tari_config_example.toml
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.
I suppose so, because it's used in base node :-) But I will double check.
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.
Thanks!
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.
Some of them were missing, @sdbondi can you please review the tari_config_example.toml
changes?
A nice followup would be to add notifications for sent transaction, received transaction, coinbase output won, coinbase output matured, etc. |
497f85e
to
10c6ce0
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.
Lightly tested - looks good - not sure what UX discussions were had around this feature, but feels like a whole tab for updates is overkill. Something like Version: 0.9.6 (New version: 0.9.7)
in the footer should be enough?
EDIT: A general purpose notifications area as @delta1 says also sounds good - will wait for tests to pass to approve because I think there will still be updates due to the changed fn signature on Wallet::new
applications/tari_console_wallet/src/ui/components/notification_tab.rs
Outdated
Show resolved
Hide resolved
applications/tari_console_wallet/src/ui/components/notification_tab.rs
Outdated
Show resolved
Hide resolved
f9d5378
to
1f0d85d
Compare
Yes, it's currently used only for updates. But the purpose is general. You can add add_notifcation in the wallet_event_monitors to any events you like. I did test the notification behavior by adding the state of the base node. Yeah, I suppose the tests will reveal some issues. |
That would be nice. Maybe we can discuss this today. |
1f0d85d
to
cd962b6
Compare
Some test failures |
cd962b6
to
603f19c
Compare
Changed the |
Just needs clippy |
Add update notification to the wallet.
603f19c
to
d325ff0
Compare
Done. |
Add general notifications support for console wallet.
Add update notification to the wallet.
Description
The wallet now supports notifications. In case of notification the notification tab will change color and show number of notifications so the users knows there is something. Once you sees them the counters goes to zero and the color to white.
Motivation and Context
It's the preparation for the auto update feature. Currently it's just notification for the update availability.
How Has This Been Tested?
The general notifications was tested by adding notification from the base node change.
The auto update was not tested yet.