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

Open Beginner friendly
#79 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

The issue identifies the CORS allowlist in the installed dist-server/index.js and the upstream fix in server/mobile/request.ts. Read those files and check how the server package is built and published for own-server installs. Done when a fresh install includes the needed preflight headers and the reported /api/events request no longer gets a 403.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
277
Forks
27
Avg merge
2h 47m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DuskBotAI/duskbot

All issues in DuskBotAI/duskbot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.