Commit graph

10 commits

Author SHA1 Message Date
Roland
5b3f1bef9d
fix: update to alby go-nostr fork which reconnects after receiving CLOSED message (#2331) 2026-05-11 12:34:56 +07:00
René Aaron
ed7e10cf25
feat: user labels for transactions (#2265)
* feat: user labels poc

* feat: backend for transaction user labels

Add PATCH /api/transactions/:paymentHash/label that merges a
user-supplied {key:value} map into the existing transaction metadata
under the user_label key, preserving NIP-47 fields. Empty map clears
the labels. Trims whitespace, drops blank rows, caps key/value length.

Wire the frontend editor to call the endpoint and revalidate the
transactions SWR cache on success.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: include user labels as columns in CSV export

Collect the union of user_label keys across all exported transactions
and emit each one as its own label_<key> column. The existing metadata
JSON column is preserved so importers like Raccoin keep working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: drop hardcoded label suggestions, autocomplete from prior keys

Open the editor with a single blank row instead of four pre-seeded
fields. Suggest label keys via a datalist populated from any
user_label keys already present in the SWR transactions cache, so
suggestions reflect the user's own taxonomy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: inline label editor and indicator-only list row

Replace the nested label dialog with an inline editor that toggles
within the existing transaction detail dialog, removing dialog
stacking. In the transactions list, replace per-label badges with a
single tag icon next to the timestamp so row height stays uniform; the
full labels remain visible in the detail view.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: don't bump updated_at on metadata-only edits

GORM's Update auto-touches updated_at, which made the transactions
list reorder labeled transactions to the top. Switch
SetTransactionMetadata to UpdateColumn so only the metadata column
changes. Add regression test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: route PATCH transaction label requests in wails

The desktop app routes API calls through WailsRequestRouter rather
than HTTP. Add a handler for PATCH /api/transactions/:hash/label
before the existing transaction lookup so labels work in Wails too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: finalize backend

* chore: rename to labels

* chore: finalize frontend

* chore: use tx id to add user labels

* chore: address minor nits

* fix: linting

* fix: use explicit primary key lookups

* chore: simplify transaction csv label export

* fix(frontend): drop label count from transaction list badge

The count adds visual weight without informing any decision from the
list view. The icon-as-badge already signals labels exist; the actual
values are in the details dialog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(frontend): revert transaction list label indicator to bare icon

The Badge wrapper made the icon-only indicator wider than tall, which
looked off. Restores the pre-PR look — a small TagIcon next to the
timestamp — since the in-dialog editor is the place to see actual labels.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-04-30 13:13:07 +02:00
Roland
87146bf80b
fix: handle unexpected subscription closure from relay pool (#1911)
* chore: log go-nostr debug messages

* fix: handle unexpected subscription closes from relay

* chore: also output messages from go-nostr info logger in debug mode

* chore: temporarily use forked go-nostr fix

* chore: update forked go-nostr fix

* fix: relay shows as offline on startup

* chore: update go-nostr

* chore: remove debug tags

* chore: run go mod tidy

* fix: only get relay statuses once
2025-11-18 11:03:51 +07:00
Roland
377a3169c6
feat: support multiple relays (#1802)
* feat: support multiple relays (WIP)

* fix: multiple NWC url construction for multiple relays

* fix: startup

* chore: update go-nostr to fix pool relay reconnect

* fix: split nip-47 queue info publish event for each relay url

* fix: add relayUrls to dispatched nwc success events

* fix: ensure newly created app info publishing is not blocked by sleep from failed publishes

* feat: multiple relays improvements

- update app deleted and updated consumers to handle multiple relays
- handle multiple relays in healthcheck
- display relay online status in about page
- renaming and improved comments

* chore: simplify error messages

* fix: unnecessary db error log when checking if app has notification permission

* fix: tests

* chore: remove old comment

* fix: app wallet subscription context usage
2025-11-06 18:01:09 +07:00
Roland
0aab4cd0d5
chore: lookup app by id instead of wallet pubkey when publishing nip47 info (#1638) 2025-08-21 16:47:39 +05:30
Roland
6300c5deff
fix: re-enqueue failed info publish request (#1300) 2025-05-08 20:21:59 +07:00
Roland
3e1d16d423
Feat: NWA auth for self-hosted hubs (#1016)
* feat: nwc create_connection command (WIP)

* feat: allow creating superuser apps from the ui

* fix: pass methods rather than scopes in create_connection method

* chore: add extra tests

* fix: use browser router in http mode

* fix: update links to not use hash router

* fix: add redirect from hash router url

* fix: return nostrWalletConnectUrl in nwc connection success event and message

* feat: publish nwa event

* chore: use nwc info event instead of nwa event

* feat: create custom alby go detail page

* chore: allow creating/editing apps with the same name

* fix: convert budget from msats to sats (#1111)

* chore: address NWA feedback

* chore: address feedback

- adjust button copy
- make create_connection methods consistent with http deeplink flow
- remove unused constant
- add empty string check before adding lud16 tag
- fix test

* feat: add support for notification_types in create_connection method

* fix: shorter button copy

* fix: do not include lud16 tag in published info event

* Feat: add lud16 to get_info response (#1128)

feat: add lud16 to get_info response

* chore: minor alby go screen improvements

* fix: incorrect unlock password error message to create app with superuser access

* chore: minor ui improvements on alby go detail page

* chore: avoid duplicate app names by adding a suffix

* chore: move scopes check to apps service, add new tests, DRY controller test setup

* fix: scopes component full access scopes and isolated scope group check

* fix: use supported capabilities for Alby Go

* fix: return correct app name

* chore: address minor comments

---------

Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2025-02-27 19:12:55 +07:00
Roman D
85d89bf93a
chore: suppress error logs on shutdown (#1049) 2025-01-31 14:32:17 +07:00
Roland
0063bf09cf
feat: add budget warning event, rename app events (#813) 2024-11-27 14:45:33 -06:00
frnandu
5fdc803f7a
feat: app child key derived from wallet master key (#736)
* feat(appwalletKey): add GetBIP32ChildKey

* feat: fix interface

* feat: adding subscription WiP

* feat: handle nostr subscriptions for lifecycle of apps

* Delete .idea/.gitignore

* Delete .idea/hub.iml

* Delete .idea/modules.xml

* Delete .idea/vcs.xml

* fix: remove unnecessary

* fix: missing handling legacy app

* fix: review fixes

* fix: use app.ID for key calculation instead of passing in event

* fix: add TODO

* fix: remove unnecessary check

* fix: improve err handling and remove check

* chore: store master nostr key to avoid deriving each time

* chore: rename app nostr_pubkey to app_pubkey, extract app consumers into separate files

* chore: finish renaming

* fix: update app wallet pubkey on app creation

* fix: not NULL check

* fix: fix HandleEvent

* fix: error handling

* fix: error handling

* fix: move StartSubscription to start.go

* fix: remove duplicated error check

* fix: make tests use AppsService for creating apps

* chore: remove unused code

* chore: minor event handler improvements

- fix error code response when failing to update request event
- fix log content when failing to decrypt request event
- move logging of app to correct place

* fix: add event_handler tests for legacy app

* chore: add comment about legacy apps in deleteAppConsumer

* fix: remove unused app from tests

* fix: error handling in startAppWalletSubscription

* fix: only create event info and nostr subscription for master key if there are legacy apps

* fix: add legacy tests

* fix: move fetching of Nip47 event info to deleteAppConsumer

* fix: fixed arguments

* fix: use require instead of assert

* fix: adapt GetAppWalletKey to use DeriveKey with path 1'

* fix: for backends that don't use a mnemonic, create appKey from nostrSecretKey

* fix: cleanup eventPublisher Subscribers when relay reconnects

* fix: bip32.FirstHardenedChild + appID

* fix: remove unused env vars

* fix: generate new mnemonic if empty

* fix: add tests.CreateTestServiceWithMnemonic to fix TestEncryptedBackup

* fix: handle both relay and main ctx Done

* chore: add keys tests

* chore: add extra assertions to keys test

* chore: log when legacy app subscription is created

* chore: remove unnecessary break

* chore: add log when relay is successfully connected

* fix: only auto-start node if it has been started before

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2024-11-07 19:06:01 +07:00