Card 465 is fixed. (+59/−12, +0 mod, tests +1 test files(ts)) #27

Merged
Connor merged 1 commit from build/5dda1370 into main 2026-10-25 22:30:52 +00:00
Owner

What changed

code: src/lib/update.ts and src/main.ts; 4 files; selfupdate and update cases (+243/−18)

build/5dda1370 → main — 8 file(s), +243/−18.

  • source: 2 file(s), +59/−12

  • other: 4 file(s), +6/−5

  • tests: 2 file(s), +178/−1

  • manifest.json

  • package-lock.json

  • package.json

  • src/lib/update.ts

  • src/main.ts

  • test/selfupdate.test.ts

  • test/update.test.ts

  • versions.json

Growth

  • source: +59/−12 (net +47; budget +600)
  • modules: +0/−0 (budget +1)
  • test files added: 1; migrations: 0; evidence (screenshot/capture, not source): 0; not counted: 1
  • test shape (advisory): tests +1 test files(ts)
  • within budget

Why

Joel, card 465 is fixed. The update button no longer loops, and the plugin is bumped to 0.4.3 so it publishes. The gate passed: npm run gate ran 299 tests, all passing, with the type check and build check green. I had no way to run Obsidian from here, so the fix is proven by tests on the real plugin code against a fake plugin manager, not by a click in Obsidian. The first time you'll see it work for real is the 0.4.2 → 0.4.3 update.

Obsidian now re-reads the plugin manifests during the reload

When the plugin reloads itself after an update, it now turns itself off, has Obsidian re-read the plugin manifests from disk (app.plugins.loadManifests()), then turns itself back on. Before, Obsidian rebuilt the plugin from the manifest it had cached at startup, so the new code ran under the old version number. That's why your row still said 0.4.0 and offered 0.4.1 again.

  • If Obsidian has no loadManifests: the plugin doesn't reload itself at all. A half-reload would come back under the old number. Instead you get a notice: restart Obsidian, or turn the plugin off and on.
  • If the re-read fails: the plugin still turns itself back on, so it is never left disabled, and the notice asks for a restart.

The row can no longer offer what's already installed […]

Gate

npm run gate ran 299 tests in 4.7s and exited 0 — green.

Flow engine

⚠ Not reviewed by the flow engine. The engine errored, so this change took the direct path: no flow engine command is set (flow.route_command)

Built by Connor's frontend backburner (dispatch 5dda1370) in an isolated clone; shipped deterministically by ship.py. The full build notes were spoken in conversation and stored in memory (agent-dispatch:5dda1370). Review is the gate.


The brief this build was given

Kept for provenance. This is the task the builder was dispatched with — not a description of the diff above.

Requested: Card 465. In src/main.ts reloadSelf (main @ 675ab31f, ~line 898): after an in-place update, disablePlugin+enablePlugin re-reads main.js but Obsidian keeps the manifest it cached at startup, so this.manifest.version stays the old version, the settings row keeps offering the same update and clicking it loops. Joel hit this today going 0.4.0 → 0.4.1: the server log shows all three artifacts downloaded 200 at 17:24:19 and again 17:24:28, the plugin reloaded (the new token field is visible), but the row still read "Connor plugin 0.4.0 / update to 0.4.1". Fix: refresh the plugin manifests before re-enabling (Obsidian's app.plugins.loadManifests(), guarded by typeof like the existing calls; fall back to the "turn it off and on / restart Obsidian" notice if unavailable) so the reloaded instance carries the new version and the row says up to date. Also make sure a stale manifest can never cause the row to re-offer a version whose files are already installed (e.g. compare against the on-disk manifest.json). Add tests for both. Bump the version to 0.4.3 in all four places (manifest.json, package.json, package-lock.json, versions.json) so it publishes. Gate must be green.

### What changed code: src/lib/update.ts and src/main.ts; 4 files; selfupdate and update cases (+243/−18) `build/5dda1370` → `main` — 8 file(s), +243/−18. - **source**: 2 file(s), +59/−12 - **other**: 4 file(s), +6/−5 - **tests**: 2 file(s), +178/−1 - `manifest.json` - `package-lock.json` - `package.json` - `src/lib/update.ts` - `src/main.ts` - `test/selfupdate.test.ts` - `test/update.test.ts` - `versions.json` ### Growth - source: +59/−12 (net +47; budget +600) - modules: +0/−0 (budget +1) - test files added: 1; migrations: 0; evidence (screenshot/capture, not source): 0; not counted: 1 - test shape (advisory): tests +1 test files(ts) - within budget ### Why Joel, card 465 is fixed. The update button no longer loops, and the plugin is bumped to 0.4.3 so it publishes. The gate passed: `npm run gate` ran 299 tests, all passing, with the type check and build check green. I had no way to run Obsidian from here, so the fix is proven by tests on the real plugin code against a fake plugin manager, not by a click in Obsidian. The first time you'll see it work for real is the 0.4.2 → 0.4.3 update. ## Obsidian now re-reads the plugin manifests during the reload When the plugin reloads itself after an update, it now turns itself off, has Obsidian re-read the plugin manifests from disk (`app.plugins.loadManifests()`), then turns itself back on. Before, Obsidian rebuilt the plugin from the manifest it had cached at startup, so the new code ran under the old version number. That's why your row still said 0.4.0 and offered 0.4.1 again. - **If Obsidian has no `loadManifests`:** the plugin doesn't reload itself at all. A half-reload would come back under the old number. Instead you get a notice: restart Obsidian, or turn the plugin off and on. - **If the re-read fails:** the plugin still turns itself back on, so it is never left disabled, and the notice asks for a restart. ## The row can no longer offer what's already installed […] ### Gate `npm run gate` ran 299 tests in 4.7s and exited 0 — green. ### Flow engine > ⚠ **Not reviewed by the flow engine.** The engine errored, so this change took the direct path: no flow engine command is set (flow.route_command) Built by Connor's frontend backburner (dispatch `5dda1370`) in an isolated clone; shipped deterministically by `ship.py`. The full build notes were spoken in conversation and stored in memory (`agent-dispatch:5dda1370`). Review is the gate. --- ### The brief this build was given _Kept for provenance. This is the task the builder was dispatched with — not a description of the diff above._ > Requested: Card 465. In src/main.ts reloadSelf (main @ 675ab31f, ~line 898): after an in-place update, disablePlugin+enablePlugin re-reads main.js but Obsidian keeps the manifest it cached at startup, so this.manifest.version stays the old version, the settings row keeps offering the same update and clicking it loops. Joel hit this today going 0.4.0 → 0.4.1: the server log shows all three artifacts downloaded 200 at 17:24:19 and again 17:24:28, the plugin reloaded (the new token field is visible), but the row still read "Connor plugin 0.4.0 / update to 0.4.1". Fix: refresh the plugin manifests before re-enabling (Obsidian's app.plugins.loadManifests(), guarded by typeof like the existing calls; fall back to the "turn it off and on / restart Obsidian" notice if unavailable) so the reloaded instance carries the new version and the row says up to date. Also make sure a stale manifest can never cause the row to re-offer a version whose files are already installed (e.g. compare against the on-disk manifest.json). Add tests for both. Bump the version to 0.4.3 in all four places (manifest.json, package.json, package-lock.json, versions.json) so it publishes. Gate must be green.
build: Card 465. In src/main.ts reloadSelf (main @ 675ab31f, ~line 898): after…
All checks were successful
connor/growth lines 5,407 · headroom 116 of 400
gate / gate (pull_request) Successful in 9s
129ea1c6c3
Card 465. In src/main.ts reloadSelf (main @ 675ab31f, ~line 898): after an in-place update, disablePlugin+enablePlugin re-reads main.js but Obsidian keeps the manifest it cached at startup, so this.manifest.version stays the old version, the settings row keeps offering the same update and clicking it loops. Joel hit this today going 0.4.0 → 0.4.1: the server log shows all three artifacts downloaded 200 at 17:24:19 and again 17:24:28, the plugin reloaded (the new token field is visible), but the row still read "Connor plugin 0.4.0 / update to 0.4.1". Fix: refresh the plugin manifests before re-enabling (Obsidian's app.plugins.loadManifests(), guarded by typeof like the existing calls; fall back to the "turn it off and on / restart Obsidian" notice if unavailable) so the reloaded instance carries the new version and the row says up to date. Also make sure a stale manifest can never cause the row to re-offer a version whose files are already installed (e.g. compare against the on-disk manifest.json). Add tests for both. Bump the version to 0.4.3 in all four places (manifest.json, package.json, package-lock.json, versions.json) so it publishes. Gate must be green.

Built by my frontend backburner (dispatch 5dda1370), diff verified by git; shipped by ship.py. Nothing merges without review.
reviewer-bot left a comment

Independent review — reviewer-bot (local model qwen2.5-coder:14b)

The PR fixes the update loop issue by ensuring the plugin re-reads manifests after an update. It also adds tests to verify the behavior.

Suggestions (non-blocking)

  • suggestion src/lib/update.ts:178 — Consider adding a comment explaining why installed is checked before isNewer.
  • suggestion src/main.ts:902 — Add logging to help debug issues with manifest re-reading.
**Independent review — reviewer-bot (local model `qwen2.5-coder:14b`)** The PR fixes the update loop issue by ensuring the plugin re-reads manifests after an update. It also adds tests to verify the behavior. ### Suggestions (non-blocking) - suggestion `src/lib/update.ts:178` — Consider adding a comment explaining why `installed` is checked before `isNewer`. - suggestion `src/main.ts:902` — Add logging to help debug issues with manifest re-reading.
Connor merged commit 91a1331431 into main 2026-10-25 22:30:52 +00:00
Connor deleted branch build/5dda1370 2026-10-25 22:30:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ZSDev/obsidian-connor!27
No description provided.