fix: address PR review feedback across channel system

- MediaStore: use full UUID to prevent ref collisions, preserve and
  expose metadata via ResolveWithMeta, include underlying OS errors
- Agent loop: populate MediaPart Type/Filename/ContentType from
  MediaStore metadata so channels can dispatch media correctly
- SplitMessage: fix byte-vs-rune index mixup in code block header
  parsing, remove dead candidateStr variable
- Pico auth: restrict query-param token behind AllowTokenQuery config
  flag (default false) to prevent token leakage via logs/referer
- HandleMessage: replace context.TODO with caller-propagated ctx,
  log PublishInbound failures instead of silently discarding
- Gateway shutdown: use fresh 15s timeout context for StopAll so
  graceful shutdown is not short-circuited by the cancelled parent ctx
This commit is contained in:
Hoshina
2026-02-23 06:03:23 +08:00
parent f4b0f080e2
commit db3c1e011f
20 changed files with 187 additions and 47 deletions
+7 -1
View File
@@ -190,7 +190,13 @@ func gatewayCmd() {
fmt.Println("\nShutting down...")
cancel()
msgBus.Close()
channelManager.StopAll(ctx)
// Use a fresh context with timeout for graceful shutdown,
// since the original ctx is already cancelled.
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 15*time.Second)
defer shutdownCancel()
channelManager.StopAll(shutdownCtx)
deviceService.Stop()
heartbeatService.Stop()
cronService.Stop()