cryptoadvance / cryptoadvance/specter-desktop

Create User Notification System

Open
#1,695 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
847
Forks
259
Avg merge
6d 18h
Merged PRs (30d)
2

Description

For different reasons, it might be usefull to notify users of events which are asnc, e.g.:
* Rescan UTXO
* Transactions arrived
* PSBT got created (e.g. via REST)
* ...

To implement this, we should create a Notificationsmanager which derives from the GenericManager so that it can persist notifications on disk. So field could be something like:
```
{ "date": "somedate",
"msgid": "some ID e.g. UUID or hashing the msg/user/date",
"user":"the targetuser-ID",
"deleted": "boolean which works as a deleted-marker",
"category": "Maybe warning, error or so",
"msg": "some message",
"firstRead":
"when it got read by the user" }
```
The NotificationManager should then have methods like:
```
def create_msg(...):

def msgs_for_user(user):
# returns all the msgs for a specific user

def mark_read(msgid):

def delete_msg(msgid):

```

From a UI/UX perspective, we should implement this is stages. The easiest stage would be to check the NotificationManager with each and every request from the browser whether new notifications are there and immediately flash them (and delete them).
This could be done via @app.before_request (see `controller.py`).
In a second stage, we could let the browser poll via API.
In further stages, we could create a UI for managing notification to read older ones and delete them finally.

Contributor guide

Open the contributing guide

Research direction

Start by reading GenericManager and controller.py, especially the browser request flow around @app.before_request. Clarify the notification data model and the first implementation stage before choosing a persistence and delivery approach. Done would mean a defined manager API and an agreed initial notification flow, with later polling and UI stages scoped separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.