Repository navigation
fix: the 24 findings of the nightly review - #447
Merged
Merged
Conversation
…es to the unlock follow-up Background The review of nightly found two statements that no longer match the code. README.md still listed the Paperless-ngx user name among the things to have ready for the wizard and in its Paperless-ngx step, although PAPERLESS_USERNAME was removed and the wizard signs in with the token alone. CLAUDE.md said OCR_BEFORE_AI applies to scan and webhook only, while the caller profile `unlock` in services/documentPipeline.js sets applyOcrBeforeAi too. Changes - README.md: "First run" and wizard step 3 name URL and token only. - CLAUDE.md: OCR before AI names scan, webhook and the unlock follow-up. Testing Prettier check on both files. Impact Documentation only. Upstream Status Not applicable: Zettelrobbe-only documentation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background Releases v2026.11.01 to v2026.11.03 carry `highlights`, the short list the welcome dialog shows after an update. v2026.11.04 had none, so the dialog showed all 28 entries of the full list, technical ones included. The entry on OCR before the first analysis also still named the topic "OCR fallback", which this release renamed to "OCR". Changes - config/changelog.js: eight highlights for v2026.11.04 (Quick start, OCR before the analysis, read right away, Task runner, Set by the environment, unlocked PDFs, the removed settings, the pointer to the full list). - The OCR-before-AI entry says Settings → OCR. Testing node scripts/run-tests.js --test welcome-changelog-modal: passed. Prettier and ESLint on config/changelog.js: clean. Impact The welcome dialog after the update to v2026.11.04 shows the short list; Settings → Changelog keeps the full one. Upstream Status Not applicable: Zettelrobbe-only changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background:
When docker-compose sets SETUP_OCR_VALIDATION_TIMEOUT_MS=30000, the topic
"Set by the environment" lists it under the values Zettelrobbe could not
change and says to delete the line without taking it over. The same row was
still takeable, and "Take over all" stored 30000 as a copy. Once the line was
gone, that copy kept OCR at 30 seconds for good: the migration
CFG-OCR-TIMEOUT-001 that raises a stored 30000 has run by then.
Changes:
- services/environmentOverview.js: every BLOCKED_CHANGES entry carries a
one-sentence `reason`. takeOverTarget() refuses a value in effect that is a
blocked change before the field's own check; the overview row and
planTakeOver() both use it, so the row has canTakeOver false with that
reason, "all" leaves it out, and an explicit request for the key is refused
like other refused keys (422 when nothing else is stored).
- routes/settings.js: the take-over endpoint's description names the case;
OPENAPI/openapi.json regenerated.
Testing:
- tests/test-environment-overview.js: the 30000 row cannot be taken over and
gives the reason; a custom blocked change does the same; planTakeOver("all")
leaves it out, a request for it is refused, " 30000 " counts as 30000,
60000 is still taken over.
- tests/test-environment-take-over.js: in both config modes the route
refuses the key with 422 and "all" stores nothing for it.
- Both fail without the change.
Impact:
The row still shows with its reason, like other rows that cannot be taken
over. No change for any other value of the key.
Upstream Status:
Not applicable: Zettelrobbe-only code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
… a redirect
Background:
The external API follows its redirects itself. The configured headers went
only to the exact origin the user entered, which includes the scheme: a
proxy that sends http://host/x on to https://host/x got the request without
X-Api-Key or Authorization and answered 401, so the analysis ran without
the external data (with axios following, the headers went along on the same
host). The request body had no such rule: on 307 and 308, and on 301 and 302
for a method other than POST, EXTERNAL_API_BODY followed to any host that
passed the SSRF check, although a body can hold a token as well.
Changes:
- services/externalApiService.js: isEnteredAddress() is the one rule for
both: the entered origin, or the same host name when a redirect only
upgrades http to https on the default ports (80 to 443, or no port to no
port). The headers go to such a hop and stay behind elsewhere. A hop that
would carry the body (after the 301/302/303 method rules) to any other
address is refused with RedirectRefusedError ("The request body goes only
to the address you entered"); fetchData() then logs one line and returns
null, as for every refused redirect. The block comment above
MAX_REDIRECTS states the rule.
Testing:
tests/test-external-api-redirects.js, new and changed cases:
- http to https on the same host keeps the headers, with and without the
explicit ports 80 and 443, also for a further hop on that https origin
- a POST 307 from http to https on the same host keeps the body
- an upgrade to another port or host gets no headers
- POST 307/308 and PUT 301/302/307 to another host are refused before any
request reaches it, with one log line naming the reason
- POST 301/302 and GET 307 to another host are followed as before, without
the headers and without the body
- https to http stays refused (unchanged cases)
The new cases fail without the change; tests/test-external-api-data.js
passes unchanged.
Impact:
An endpoint behind an http-to-https redirect works again with its API key.
A redirect that would hand the body to another host ends the call; the
analysis runs without external data, as for every refused redirect.
Upstream Status:
Not applicable: Zettelrobbe-only code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background: fetchData() logged "Fetching data from external API: <url>" with the address as entered. An address can carry a key in its user name and password (user:pass@host) or its query (?key=...), and both ended up in the log. The redirect log lines already went through addressForLog(). Changes: - services/externalApiService.js: the line prints addressForLog(new URL(url)), the address without user name, password, query and fragment. The address has passed validateApiUrl() at that point, so it parses. Testing: - tests/test-external-api-redirects.js, case 11: an address with user, password, query and fragment is fetched; the log line names only scheme, host, port and path, and none of the four parts appears in any line. It fails without the change. Impact: Log only. The request itself still goes to the address as entered. Upstream Status: The log line predates this fork's own history and appears to come from upstream clusterzx/paperless-ai unchanged; addressForLog() is Zettelrobbe code, so the fix is not offered upstream as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background: server.js arms the OCR cron only after the DISABLE_AUTOMATIC_PROCESSING check, because a drain writes OCR text and analysis results back to Paperless-ngx, which is what that switch stops. OCR_RUN_RIGHT_AWAY bypassed it: afterRun() did not look at the switch, so with both on every webhook, rescan or "Scan now" that queued a document started a drain until the queue was empty, older entries included. The unlock follow-up already respects the switch. Changes: - services/ocrAutoProcessService.js: isRightAwayEnabled() is false while config.disableAutomaticProcessing is "yes", read on every call as server.js reads it. afterRun() therefore starts no drain and drops any held trigger, startWaitingDrain() and a running drain's next batch stop the same way, and the dashboard's activity endpoint reports rightAway false. Testing: tests/test-ocr-run-right-away.js: - with DISABLE_AUTOMATIC_PROCESSING=yes, afterRun() returns null and holds no trigger; a scan, a webhook document and a rescan queue the document and OCR reads nothing, also not a row queued earlier - setting DISABLE_AUTOMATIC_PROCESSING=yes while a trigger is held drops the trigger after the running batch Both fail without the change. Impact: With automatic processing off, queued documents wait for "Process All Pending" as the OCR cron's documents do. No change while it is on. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…without a restart Background: paperlessService.CACHE_LIFETIME read TAG_CACHE_TTL_SECONDS on its first use and kept the value for the life of the process (_cacheTTL). The setting's catalogue entry has no restart flag, and config/config.js reads every value on every access so that a saved value applies to the next call. Only POST /settings reset the cached value after a change of this key; any other change of the variable went unnoticed until the next start, against the rule that no service caches a config value. Changes: - services/paperlessService.js: CACHE_LIFETIME reads config.tagCacheTTL on every use (default 300 seconds, as before). The _cacheTTL field is gone. The tag, correspondent and document type caches all use the getter. Testing: - tests/test-tag-cache-ttl.js (new, area ocr): CACHE_LIFETIME follows process.env.TAG_CACHE_TTL_SECONDS on every read and falls back to 300 seconds; ensureTagCache() keeps or refreshes a two-minute-old cache by the lifetime in effect at the call; the catalogue entry needs no restart. The first two cases fail without the change. - tests/test-settings-save-golden.js and tests/test-tag-simplify-service.js pass unchanged. Impact: A changed tag cache lifetime applies to the next cache check. The reset in POST /settings (routes/settings.js) is now a no-op and can go together with the golden test's tagCacheReset field. Upstream Status: The cached getter predates this fork's own history and appears to come from upstream clusterzx/paperless-ai; not reported upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
… waiting Background: After a PDF's password is removed, the unlock follow-up holds the document's pipeline claim for up to 15 minutes while it waits for Paperless-ngx to store the unlocked version. A rescan by hand only asked documentPipeline.isWaitingForOcr(): it deleted the processed, history and original rows, answered "queued", and the webhook queue then dropped the entry at the claim. The document did come back through the follow-up or the next scan, but the answer was wrong and the original data was gone. Changes: - services/webhookQueueService.js: rescanDocumentsByIds() treats a document unlockFollowUpService.isWaiting() names like one waiting for OCR: its records are kept, it is neither fetched nor queued, and it comes back in `waitingForOcr`. The follow-up is required inside the function, because it requires this module. Unlike the OCR hold this one does not depend on the OCR switch, since the follow-up holds the claim either way. - routes/history.js: the @Swagger text of both rescan endpoints names the case; OPENAPI/openapi.json regenerated. Testing: tests/test-rescan-waiting-for-ocr.js, two new cases with a follow-up whose clock stands still: - with OCR on and off, the rescan keeps the rows, fetches and queues nothing, lists the id in waitingForOcr, and the claim stays with the follow-up - POST /api/history/:id/rescan answers waitingForOcr: true and POST /api/history/rescan lists the id; once the follow-up is over the rescan goes ahead Both fail without the change. unlock-follow-up, document-pipeline-callers and rescan-fetch-before-delete pass unchanged. Impact: The history page says the document waits instead of "sent for rescan"; its wording ("waiting for OCR") is unchanged. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…ns out Background: The unlock follow-up waits up to 15 minutes for Paperless-ngx to store the unlocked version, and it looks only while it holds the document's pipeline claim. When another run held the document for the whole wait, the follow-up never asked Paperless-ngx at all, and still logged "Paperless-ngx has not stored the unlocked version within 15 minutes". Changes: - services/unlockFollowUpService.js: at the deadline the follow-up checks whether it ever got the claim (once claimed it keeps it until it ends). If not, the line says that another run held the document, so the follow-up never got to it; the next scan processes it. The line for a version Paperless-ngx did not store is unchanged. Testing: - tests/test-unlock-follow-up.js: a new case holds the claim for the whole wait and pins the new line, and that Paperless-ngx is not blamed; the existing timeout case now pins its line word for word. The new case fails without the change. Impact: Log wording only. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background: While Paperless-ngx stores the unlocked version of a PDF, the Manual page asks every ten seconds whether it is there and loads the document anew once it is. The check only asked whether the page still showed that document (state.doc), not whether another one was loading (state.fetching). If the check for A fell into the load of B and A had been unlocked meanwhile, it loaded A again; B's answer then counted as an older load and was dropped, and the page showed A instead of the document the person had just picked. Changes: - public/js/manual.js: the check counts as current only while no other document is loading, so it neither asks for A nor loads it while B is on its way, also when B starts while the check waits for its answer. When a load fails, the document still shown resumes its check, so A goes on waiting for its unlocked version if B cannot be loaded. Testing: - tests/test-manual-unlock-check.js (new, area ocr): runs manual.js in a vm context with stand-in elements, a fetch table and timers the test fires. The check loads A once it is unlocked; with B loading at the moment the check fires, or starting while the check waits for its answer, A is not loaded and B is shown; if B fails, A stays and is checked again. The last three cases fail without the change. - tests/test-manual-page-routes.js passes unchanged. Impact: Only the Manual page while a document waits for its unlocked version. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
… path Background: v2026.11.04 changed what two fields of the settings save mean, and neither was in the OpenAPI spec: ocrValidationTimeout (seconds, default 120 instead of the old form's 30) and externalApiTransform (a path into the answer, no longer JavaScript). aiTagName said only "Tag name to use", although an unset name and an empty one mean different things. Changes: - routes/settings.js, @Swagger block of POST /settings: - ocrValidationTimeout: integer seconds, 1 to 7200, default 120, stored in milliseconds as SETUP_OCR_VALIDATION_TIMEOUT_MS; out of range is clamped, not a number saves the default, empty or missing keeps the stored value (as settingsService.resolveOcrSettings() does) - externalApiTransform: a path such as data.items[0].name, or [0].name for a list; not code; what sends the whole answer - aiTagName: unset means ai-processed, an empty name means no tag - ocrRunRightAway: also does nothing while disableAutomaticProcessing is on (the behaviour of the read-right-away fix in this branch) - OPENAPI/openapi.json regenerated. Testing: - tests/test-settings-post-spec.js (new, area ocr) reads the regenerated spec and checks the four descriptions; it fails on the old spec. - node scripts/regen-openapi.js leaves no diff. Impact: Documentation only. The other undocumented externalApi* and ocr* fields are older gaps and stay as they are. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…vironment alone Background: For a local OCR server, mistralOcrService tries the configured address with and without /v1 and keeps the one that answers. It then wrote that address to process.env.OCR_API_URL, to config and to the stored settings without asking whether docker-compose sets the key. The value from the environment then no longer applied until the next start. Every other writer leaves such a protected key alone (config.isProtectedRuntimeEnvKey, setupService.saveRuntimeOverrides). Changes: - services/mistralOcrService.js: persistDetectedLocalOcrApiBase() returns early when OCR_API_URL is protected. It changes neither process.env nor config, stores nothing, and logs one line: the OCR API answers at the detected address, OCR_API_URL is set by the environment, which decides, so the address is not saved. The requests of this process still use the address that answered, as the detection always did. Testing: - tests/test-ocr-url-detection-env.js (new, area ocr): with OCR_API_URL in the start environment, detection against a server that answers only on /v1 returns that address, while process.env, config.mistralOcr.apiUrl and the stored settings keep theirs and the one line is logged; without it, the address is saved and applies as before. The first case fails without the change. - ocr-empty-result-guard, ocr-provider-ollama, ocr-provider-lmstudio-compatible and injected-env-priority pass unchanged. Impact: Only installations whose docker-compose sets OCR_API_URL for a local OCR server that answers on the other address style. Upstream Status: Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background Since the settings page got its save bar (8eef557), the Save button sits in #settingsSaveRow outside the form and belongs to it through form="setupForm"; the bar is there only while a change is unsaved. The browser part of tests/test-settings-tidy-up-section.js still clicked '#setupForm button[type="submit"]', which no longer exists, and timed out after 30 seconds. CI did not notice because Playwright is not installed there and the browser part skips itself. Changes - tests/test-settings-tidy-up-section.js: submitAndWait() first asserts that the change before it shows the save bar, then clicks '#settingsSaveRow [data-el="save"]'. What the test asserts about the posted values is unchanged. Testing node scripts/run-tests.js --test settings-tidy-up-section with the global Playwright and Chromium: 32 passed, 0 failed (before: 31 passed, 1 failed, "Fetch models fills the picker and keeps the stored model selected"). ESLint, Prettier, typecheck: clean. Impact Test only. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…22, 23) Items 4, 5 and 9 together, 7, 8, 10, 11, 12, 20, 22 and 23 of the review of nightly: no take-over of the old OCR timeout, one redirect rule for headers and body of the external API, read right away respects DISABLE_AUTOMATIC_PROCESSING, a live tag cache lifetime, honest rescans during an unlock follow-up, the right cause in its log line, the Manual unlock check, the POST /settings spec, a log line without credentials and an OCR address detection that leaves a protected OCR_API_URL alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background
The save bar of the settings page counts what a save sends. The section
"Ask a server" (Detect models, #sec-quickstart-auto-detect) posts nothing:
its address, key, model choices and OCR switch only feed the detection and
the Apply button. Its body carried no data-not-a-setting, though, so
typing a server address showed the save bar ("Server address"), marked the
topic as changed and armed the leave-page warning. The test that claimed
to check this looked for the attribute anywhere earlier in the HTML and
found the one of the MFA section.
Apply, on the other hand, wrote the real fields of AI provider and OCR
with .value and .checked and fired only a non-bubbling change on the
provider. The form's listeners never heard of it: the bar appeared only
because of the section's own fields, and with those fixed nothing would
show the bar, and with it the only Save button, after Apply. Discard after
Apply then left a phantom change behind: Apply refills the model lists, so
the model in use was no longer an option to go back to.
Changes
- views/settings.ejs: the body of Ask a server carries
data-not-a-setting (countsAsSetting() in settings-form.js already skips
it).
- public/js/settings.js:
- announceEdit(field): a bubbling input and change, the way a person's
edit arrives.
- setSwitchValue() announces the visible switch and its hidden yes/no,
and leaves a switch the environment sets alone.
- applyQuickstartDetectionToForm() writes provider, address, key and
model, and for OCR the switch, provider, address, key and model,
one at a time through writeField(), which skips a field the
environment sets (disabled) and announces each one. The provider
gets input as a person's pick does; its preset may fill address and
model, which Apply then replaces.
- public/js/modules/settings-form.js: Discard offers a select's value in
use again when a refilled list no longer has it (ahead of a model
picker's "Other…"), so Discard after Apply or Fetch models restores
the model.
- tests/test-settings-save-bar.js: the page test walks the element tree
and asserts that every control of Ask a server, the custom-field add
row, MFA and the .env output sits inside an element carrying
data-not-a-setting, and that the real fields Apply writes do not. It
fails when the attribute is removed from Ask a server.
- tests/test-settings-save-bar-browser.js: in headless Chrome, typing,
detecting (stubbed) and choosing in Ask a server shows no bar, no topic
mark and no leave warning; Apply writes the fields, the bar names "AI
provider, Server address, API key, Model, Use OCR, Server address
(optional), OCR API key, OCR model", the topics AI provider and OCR are
marked and Quick start names the model; Discard puts every field back
and the bar goes.
Testing
- settings-save-bar, settings-save-bar-browser, settings-tidy-up-section,
settings-quick-start, settings-custom-fields-selector-sync,
settings-layout: pass.
- Checked that the new assertions fail on the old code: old settings.ejs
-> the page test and "typing ... no unsaved change" fail; old
settings.js -> "Apply writes the real fields" fails (no bar); old
settings-form.js -> "Discard after Apply" fails ("OCR model" stays).
- typecheck, ESLint, Prettier: clean.
Impact
Settings page only. Nothing saved changes; the bar now names exactly the
fields a save sends after Apply. A field set by the environment is no
longer overwritten on screen by Apply.
Upstream Status
Not applicable: Zettelrobbe-only code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background The list of custom fields posts through one hidden value, #customFieldsJson, which the save bar counts as "Custom fields" since 8eef557. Discard put that value back but left the visible rows alone. A field added and then discarded stayed on screen; the next edit of the list rebuilt the value from the rows (updateCustomFieldsJson()) and the discarded field was saved after all. A field removed and then discarded did not come back. Changes - public/js/settings.js: - customFieldsListJson: the value of #customFieldsJson the rows stand for, set when the page loads and by updateCustomFieldsJson(). - followCustomFieldsJson(): on a change of #customFieldsJson that the list did not make (Discard), the rows are drawn again from the value with createFieldElement(). The value stays the one thing that posts. - tests/test-settings-save-bar-browser.js: with two stored fields, in headless Chrome: add, Discard -> the added row goes and the value is back; the next add starts from the restored list; remove, Discard -> the removed row comes back (with its currency); the next remove posts only the remaining field. Testing - settings-save-bar-browser, settings-custom-fields-selector-sync, settings-custom-field-type-conflict: pass. - With the previous settings.js the new test fails ("an added field goes": the row and the value stayed). - typecheck, ESLint, Prettier: clean. Impact Settings page only. Discard no longer leaves custom fields on screen that a later edit would save, and brings removed ones back. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…switch Background A provider switch puts each model picker (today "Model for Tidy up") back on its placeholder and its stored value: resetModelPickers() reads data-stored-value, which the page renders once. A save without a reload did not update it. Saving a Tidy up model and then switching the provider brought back the model the page was loaded with, and the next save lost the model just saved. Changes - public/js/settings.js: after a successful save, each model picker's data-stored-value becomes the value the save posted (a picker the environment sets posts nothing and keeps its value). - tests/test-settings-tidy-up-section.js: in a browser, fetch models, pick o4-mini, save, switch the provider to Azure: the picker offers and selects o4-mini; Discard returns the provider and keeps o4-mini. Testing - settings-tidy-up-section with the global Playwright and Chromium: 33 passed. Without the change the new test fails (the picker falls back to the model from page load). - typecheck, ESLint, Prettier: clean. Impact Settings page only. A saved Tidy up model survives a later provider switch and Discard in the same page. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background The settings page and the server accept an OCR timeout of 1 to 7200 seconds (views/settings.ejs max="7200", the check in settings.js, setupService and getOcrValidationTimeoutMs() of the wizard itself, which clamp to 7200). The wizard's field said max="120" and step 5 refused anything above 120 seconds. Since the wizard prefills the field from the configuration, a stored 300000 ms showed 300 and blocked step 5 with "between 1 and 120 seconds"; the new default of 120 seconds sat right on the old limit. Changes - views/setup.ejs: the OCR timeout field allows 1 to 7200. - public/js/setup.js: step 5 checks 1 to 7200 seconds and says so in its message. - tests/test-setup-wizard-quickstart.js: a stored 300000 ms prefills 300 and step 5 passes; 7200 passes; 7201 and 0 are refused with the new message; the field's max is 7200. Testing - setup-wizard-quickstart, setup-preset-manual-reset, setup-wizard-tag-default, ocr-timeout-default: pass. With the previous setup.js the extended test fails (step 5 refuses 300). - typecheck, ESLint, Prettier: clean. Impact Setup wizard only. An OCR timeout above two minutes, stored or typed, no longer blocks the wizard. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background The overlay shown while the chosen models are tested comes from one partial (views/partials/model-test-overlay.ejs). The settings page sets its status to "Testing the chosen models on the server…"; the setup wizard still set the older "Validating the selected models against your AI server…". Changes - public/js/setup.js: runQuickstartSaveFlow() sets the same sentence as public/js/settings.js. Testing grep over public/, views/ and tests/: the old sentence is gone, the new one appears in settings.js and setup.js. setup-wizard-quickstart passes. ESLint, Prettier, typecheck: clean. No test of its own: one string. Impact Wording in the setup wizard only. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…CR topic Background Quick start asks "When should OCR run?" when OCR is switched on during a visit while neither of its two switches (ocrRunRightAway, ocrAutoProcessEnabled) is on: the picker shows no answer and the OCR step stays open. Only the picker or OCR going off cleared that. Turning on "Run right away" (or the schedule) in the OCR topic decided the timing just as well, but the picker stayed empty and the step stayed open. Changes - public/js/modules/settings-quick-start.js: timingUndecidedNow(), a pure function, says whether the question is still open: only while OCR is on and neither switch is; then while it was open, or when OCR has just gone on. refreshTiming() asks it on every refresh, so a switch turned on anywhere shows its timing in the picker and the step counts as done. - tests/test-settings-quick-start.js: the cases of timingUndecidedNow() (asked when OCR goes on, kept while nothing answers, settled by each of right-away, schedule and both, nothing asked with OCR off or on at page load), the step is done with the answer, and refreshTiming() uses it. Testing - settings-quick-start, settings-quickstart-persistence: pass; the new test fails on the previous module. - In headless Chrome on the router harness: OCR switched on in its topic -> picker empty, step open; "Run right away" switched on in the OCR topic -> picker "right-away", step done (before: picker empty, step open). - typecheck, ESLint, Prettier: clean. Impact Quick start only. No setting or saved value changes. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background
The Redirect URI field of single sign-on is an override
(OIDC_REDIRECT_URI): left empty, the server derives the address from the
request, so it follows the address people open. Without the Clipboard
API, which a page served over plain http does not have, Copy fell back to
writing the derived address into the empty field and selecting it. Saved
after that, the redirect URI was fixed and no longer followed a later
change of domain or proxy.
Changes
- public/js/modules/settings-sso.js:
- copyWithoutClipboardApi(text): copies through a temporary off-screen
textarea appended to the body, outside the form, and
execCommand('copy'); the textarea goes again and the focus returns.
- Copy tries the Clipboard API, then that fallback; when both fail it
shows the address on a line under the field, selected for copying by
hand, and says so. The field is never written.
- views/settings.ejs: the hidden line under the field
(data-el="copy-redirect-by-hand") that holds the address for that case.
- tests/test-settings-sso-copy.js (new, registered in
scripts/run-tests.js, area settings): the module as shipped on a stub
DOM: with the Clipboard API; without it, copied through the textarea,
which never sits in the form and is gone afterwards; with execCommand
refusing or throwing, the address shown and selected under the field; a
typed override is what is copied. In every case the field keeps its
value and gets no input or change event, so nothing counts as unsaved.
Testing
- settings-sso-copy: 5 passed; on the previous module 4 of 5 fail (the
field is filled, no fallback copy).
- settings-wording, settings-layout, settings-find, settings-oidc,
settings-save-bar, settings-topics, page-rhythm: pass.
- In headless Chrome on the router harness with navigator.clipboard
removed: the fallback copies and the field stays empty; with
execCommand returning false the line appears, the address is the
selection, the field stays empty and the save bar stays hidden.
- typecheck, ESLint, Prettier: clean.
Impact
Settings page, single sign-on. Copying the redirect URI over plain http
no longer pins it on the next save.
Upstream Status
Not applicable: Zettelrobbe-only code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background settings-nav.js reads the hash of /settings to open a topic (or the topic holding a section of an old link) with decodeURIComponent(), without a try. A hash that is not valid percent-encoding, such as /settings#100% or #%E0%A4, threw while the module mounted: zr.js marked it failed, and the page was left without its topic switching, folding groups and "Find a setting". The same throw hit every later hashchange. Changes - public/js/modules/settings-nav.js: hashKey(hash) strips the "#" and decodes; text that is not valid percent-encoding is taken as written. resolve() uses it, on load and on hashchange; such a key names no topic, so the first topic opens (or the one a valid hash names). - tests/test-settings-nav-active.js: hashKey() decodes a valid hash and returns #100%, #%E0%A4, #% and #ocr%zz as written, none of which names a topic; resolve() reads every hash through it and no other decodeURIComponent is left in the module. Testing - settings-nav-active, settings-topics, settings-find: pass; the new test fails on the previous module (no hashKey). - In headless Chrome on the router harness: /settings#100% opens Quick start with the module mounted; hashchange to #%E0%A4 keeps Quick start, to #ocr opens OCR, to #sec-ocr% opens Quick start. Before: the module failed to mount (data-state="error"). - typecheck, ESLint, Prettier: clean. Impact Settings page only: an odd or mistyped link opens the first topic instead of breaking the page. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
…-17, 24) Items 1 and 2, 3, 6, 13, 14, 15, 16, 17 and 24 of the review of nightly: "Ask a server" no longer counts as an unsaved change while its Apply does, Discard restores the custom field list, the wizard takes an OCR timeout up to 7200 seconds, Quick start's OCR timing follows the OCR topic, a saved model picker survives a provider switch, SSO "Copy" leaves the redirect field alone, the Tidy up browser test saves through the save bar, the wizard's model test overlay uses the settings page's sentence, and a malformed hash no longer stops the topic list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background POST /settings reset paperlessService._cacheTTL after a save that changed TAG_CACHE_TTL_SECONDS, because the cache kept the lifetime it had read once. The tag cache now reads the lifetime from config on every use (6e414e4), so the reset touches a field nothing reads any more, and its comment no longer holds. Changes - routes/settings.js: the reset and the then unused changedKeys go. - tests/test-settings-save-golden.js: the golden record no longer observes tagCacheReset; tests/fixtures/settings-golden.json re-recorded (GOLDEN_RECORD=1, formatted with Prettier), which only drops that field. Testing settings-save-golden and tag-cache-ttl: passed. ESLint and Prettier on the changed files: clean. Impact None for users: a changed tag cache lifetime still applies after a save, now also when it changes any other way. Upstream Status Not applicable: Zettelrobbe-only code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
Background The fixes of the nightly review change one v2026.11.04 statement (where the external API sends headers and body on a redirect) and fix six things that were already in v2026.11.03. CLAUDE.md describes when the OCR queue is read right away and did not say that DISABLE_AUTOMATIC_PROCESSING now stops that too. Changes - config/changelog.js, v2026.11.04: the redirect entry names headers and body, the http to https upgrade on the same host and the refused hop; new Fix entries for the tag cache lifetime, the Tidy up model picker, SSO "Copy", a malformed settings hash, a protected OCR_API_URL and the external API log line. Fixes of behaviour new in v2026.11.04 get no entry of their own. - CLAUDE.md: with DISABLE_AUTOMATIC_PROCESSING=yes neither the OCR cron nor afterRun() reads the queue. Testing welcome-changelog-modal: passed. Prettier and ESLint: clean. Impact Settings → Changelog lists the fixes; the welcome dialog keeps showing the highlights. Upstream Status Not applicable: Zettelrobbe-only changelog and documentation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018w9EfBuX1pkx1N9SnCmuGs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Aaron · project thread
Summary
A read-only review of
nightly(ee544dc, 88 commits ahead ofmain) found 24 defects, none critical or high. This branch fixes all 24 on top ofnightly. Items 1 and 2, and items 5 and 9, are each fixed together. Every code fix comes with a test that fails on the old code.Items
views/settings.ejs,tests/test-settings-save-bar.jsinput/changeon every field it writes, so the save bar names thempublic/js/settings.jspublic/js/settings.jsservices/environmentOverview.jsservices/externalApiService.jsviews/setup.ejs,public/js/setup.jsDISABLE_AUTOMATIC_PROCESSING=yesservices/ocrAutoProcessService.jsPOST /settingsis goneservices/paperlessService.js,routes/settings.jswaitingForOcrand keeps its recordsservices/webhookQueueService.jsservices/unlockFollowUpService.jspublic/js/manual.jspublic/js/modules/settings-quick-start.jspublic/js/settings.jspublic/js/modules/settings-sso.js,views/settings.ejstests/test-settings-tidy-up-section.jspublic/js/setup.jsREADME.mdCLAUDE.mdPOST /settingsspec documentsocrValidationTimeout,externalApiTransformand theaiTagNameruleroutes/settings.js,OPENAPI/openapi.jsonconfig/changelog.jsservices/externalApiService.jsOCR_API_URLaloneservices/mistralOcrService.js#100%) no longer stops the topic listpublic/js/modules/settings-nav.jsTesting
npm run typecheck: exit 0node scripts/run-tests.js --all: 190 passed, 6 skipped (need a running server or login env), 0 failed. Baseline onnightly: 184 / 6 / 1 (item 16).node scripts/regen-openapi.js: no driftNotes
tests/fixtures/settings-golden.jsonwas re-recorded; the only change is the removedtagCacheResetfield.Generated by Claude Code