Own servers still get server 0.2.12 without d5947c7, so the phone stays on Reconnecting (403 on the /api/events preflight)

Aperta Adatta ai principianti
#79 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

L’issue indica la allowlist CORS in dist-server/index.js, installato, e la correzione upstream in server/mobile/request.ts. Leggi questi file e verifica come viene compilato e pubblicato il pacchetto server per le installazioni su server propri. Il lavoro è concluso quando una nuova installazione include gli header preflight necessari e la richiesta segnalata a /api/events non riceve più un 403.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

A fresh own-server install on 2026-11-18, from the 0.2.18 desktop app's install line, installs a server package whose package.json says 0.2.12. duskbot-server-update.timer finds nothing newer.

With that server, the iPhone app pairs and can send messages (they reach the bot and show up in the desktop app), but it stays on "Reconnecting" and never shows the bot's replies. Every retry sends this preflight:

OPTIONS /api/events?screens=off
Origin: capacitor://localhost
Access-Control-Request-Method: GET
Access-Control-Request-Headers: authorization,cache-control

The server answers 403. The installed dist-server/index.js only allows Authorization, Content-Type, Last-Event-ID, X-Dusk-Background, X-Dusk-Sha256.

main already fixes this in d5947c7 ("phone: live stream no longer stuck on Reconnecting"), which adds Accept and Cache-Control in server/mobile/request.ts, and that commit is older than the v0.2.15 to v0.2.18 tags. The server build that own-server installs receive doesn't have it.

Adding "Cache-Control" to that list in the installed file and restarting duskbot.service fixed it on my server: the preflight returns 204 and replies show up on the phone. The next server update will overwrite that local edit, so this only holds until a fixed build ships to own servers.

Steps to reproduce
  1. Install on a fresh server with the desktop app's install line.
  2. Make the server reachable from the phone and pair it (I had to work around the pairing screen; see #78).
  3. Send a message from the phone.
  4. The message reaches the bot, but the reply never shows on the phone, and the app shows Reconnecting.
Version

desktop 0.2.18, server package 0.2.12, iOS app build 2611142024

Platform

Own server (VPS), Debian 13 amd64, with the iPhone app

Lingua principale
TypeScript
Stelle
277
Fork
27
Merge medio
2h 47m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DuskBotAI/duskbot

Tutte le issue di DuskBotAI/duskbot

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.