psf-bch-api 7.3.8 → 7.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ # 2026-03-16 Update Log
2
+
3
+ ## Summary
4
+
5
+ Reduced noisy error logging for common SLP transaction misses in the `/v6/slp/txid` path.
6
+
7
+ ## Changes Made
8
+
9
+ - Updated `src/use-cases/slp-use-cases.js` in `getTxid()`:
10
+ - Added a guard for expected missing-record errors (`404` + `Key not found in database`).
11
+ - Skips `wlogger.error()` for that specific, common case.
12
+ - Still rethrows the error so API response behavior is unchanged.
13
+ - Updated `src/controllers/rest-api/slp/controller.js` in `handleError()`:
14
+ - Added the same guard to suppress duplicate error-level logs for the same expected case.
15
+ - Keeps normal error logging for all other errors.
16
+
17
+ ## Outcome
18
+
19
+ - The common "Key not found in database" case no longer pollutes error logs.
20
+ - Unexpected failures continue to be logged at error level.
21
+ - Client-facing status and error message behavior remains unchanged.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psf-bch-api",
3
- "version": "7.3.8",
3
+ "version": "7.3.10",
4
4
  "main": "psf-bch-api.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1 @@
1
+
@@ -17,4 +17,6 @@ services:
17
17
  volumes:
18
18
  #- ./start-rest2nostr.sh:/home/safeuser/REST2NOSTR/start-rest2nostr.sh
19
19
  - ./.env:/home/safeuser/.env
20
+ - ../data:/home/safeuser/psf-bch-api/production/data
21
+ - ../data/logs:/home/safeuser/psf-bch-api/logs
20
22
  restart: always
@@ -208,7 +208,14 @@ class SlpRESTController {
208
208
  }
209
209
 
210
210
  handleError (err, res) {
211
- wlogger.error('Error in SlpRESTController:', err)
211
+ const isCommonMissingTxError =
212
+ err?.status === 404 &&
213
+ typeof err?.message === 'string' &&
214
+ err.message.includes('Key not found in database')
215
+
216
+ if (!isCommonMissingTxError) {
217
+ wlogger.error('Error in SlpRESTController:', err)
218
+ }
212
219
 
213
220
  const status = err.status || 500
214
221
  const message = err.message || 'Internal server error'
@@ -98,7 +98,14 @@ class SlpUseCases {
98
98
  try {
99
99
  return await this.slpIndexer.post('slp/tx/', { txid })
100
100
  } catch (err) {
101
- wlogger.error('Error in SlpUseCases.getTxid()', err)
101
+ const isCommonMissingTxError =
102
+ err?.status === 404 &&
103
+ typeof err?.message === 'string' &&
104
+ err.message.includes('Key not found in database')
105
+
106
+ if (!isCommonMissingTxError) {
107
+ wlogger.error('Error in SlpUseCases.getTxid()', err)
108
+ }
102
109
  throw err
103
110
  }
104
111
  }