Repository navigation
fix: restart on a rewritten appservice registration - #100
Conversation
Synapse reads each appservice registration once at startup. Register Appservice restarts Synapse when it adds a file, because the path lands in app_service_config_files and main watches homeserver.yaml; rewriting an existing registration changes only the registration file, which nothing watched. A reinstalled bridge mints new tokens, re-registers, and Synapse keeps the old tokens in memory until restarted by hand, rejecting the bridge with "as_token was not accepted". main now reads every registered appservice file with .const(), so any change to one — tokens, sender, namespaces, URL — restarts Synapse the same way a new one does. The defect was reproduced on StartOS 0.4.0.2 with Synapse 1.162.0:4 and a mautrix-signal package (reinstall, run the re-raised task, bridge rejected until a manual Synapse restart). This change type-checks; it has not yet been installed on a box. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
340dc57 to
7fb90ba
Compare
helix-a
left a comment
There was a problem hiding this comment.
The registration watcher is consistent with the package's registration paths and setupMain reactivity. One release blocker: beta already serves 1.162.0:4 from f5893318f5cf86c64c946852a5640979ec92039f. This fix needs a new downstream revision so existing installs receive it as an update, rather than different code claiming the published version.
The proposal bumps current.ts in place to 1.162.0:5 and replaces the already-shipped Force-Purge Room notes with localized notes for this fix. No migration or historical version file is needed. The other open PR (#99) targets 1.163.0:0, so it does not claim this revision.
Verification: git merge-tree --write-tree origin/master HEAD passed for the reviewed PR head. SDK pin matches npm's current 3.0.6. Both the PR and proposal passed type-check, Prettier check, bundle build, and make synapse.s9pk via helix-build; inspected the returned proposal artifact and confirmed version 1.162.0:5. No runtime bridge-reinstallation test performed; automatic restart remains runtime-unverified.
Proposed changes: 7fb90ba...proposal/100
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
@helix-a I just merged 1.163.0:0 to master. Rebase this and keep that version intact |
|
Updated Rebased candidate: https://github.com/Start9Labs/synapse-startos/commits/proposal/100 Type-check, Prettier, bundling, and As the reviewer, I left the PR branch untouched. @ok can use the rebased candidate to update it. |
helix-a
left a comment
There was a problem hiding this comment.
Approved against updated master. With Matt's instruction to retain 1.163.0:0, my earlier version-bump objection no longer applies. The PR merges cleanly; the rebased candidate on proposal/100 preserves the version file unchanged and passed type-check, Prettier, bundling, and package build. Inspected the returned artifact and confirmed 1.163.0:0. Runtime bridge-reinstallation testing remains unverified.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Summary
mainnow.const()-watches every file listed inapp_service_config_files, so rewriting an existing appservice registration restarts Synapse the way adding one already does.Why
Register Appservice writes
appservices/<id>.yamland appends its path tohomeserver.yaml. On a first registration the path change restarts Synapse through the existinghomeserverYaml.read().const(). On a re-registration (a bridge package reinstalled, minting new tokens and re-raising the task throughensureAppserviceRegistration) only the registration file changes, nothing watched it, and Synapse kept the old tokens in memory: the bridge exited withas_token was not accepteduntil Synapse was restarted by hand.Verification
ensureAppserviceRegistration: reinstall the bridge, run the re-raised Register Appservice task, and the bridge is rejected until Synapse is restarted manually.tsc. It has not yet been built and installed on a box; a reviewer with a bridge package installed can confirm Synapse restarts on its own after the task runs.🤖 Generated with Claude Code