Message history with delivery tracking (GET /api/messages) (#8)
CI / build + unit (push) Successful in 32s

This commit was merged in pull request #8.
This commit is contained in:
2026-09-24 16:19:32 +02:00
parent 5292303786
commit 57ad27d66f
8 changed files with 325 additions and 6 deletions
+33
View File
@@ -107,6 +107,39 @@ export class MeshController {
return this.mesh.channels();
}
@Get('messages')
@ApiOperation({
summary: 'Message history (last 100)',
description:
'Inbound text messages and our sends, newest first. tx records start "pending" and move to "delivered"/"failed" when the routing ACK/NACK arrives; broadcasts stay "pending" because firmware strips want_ack before TX. History is in-memory only (last 100) and resets on every bridge reconnect.',
})
@ApiResponse({
status: 200,
description: 'Messages newest first',
example: [
{
id: 456789,
dir: 'tx',
to: 42,
text: 'hello testowy',
channel: 2,
at: 1758000123456,
status: 'delivered',
},
{
id: 123456,
dir: 'rx',
from: 987654321,
text: 'ping',
channel: 2,
at: 1758000000000,
},
],
})
messages() {
return this.mesh.messages();
}
@Get('nodes')
@ApiOperation({
summary: 'Known mesh nodes (lean summaries)',