Skip to content

Test the phone-side JS against real Memos servers in the CI - #18

Merged
minils merged 4 commits into
mainfrom
claude/memos-integration-test
Nov 7, 2026
Merged

minils merged 4 commits into
mainfrom
claude/memos-integration-test

Conversation

@minils

@minils minils commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

The move of the Memos API from /api/v1 to /api in Memos 26.10 (#15) only showed up on a user's watch. The mock server in test/pkjs.test.js can't catch changes like that, so this adds a test against real Memos servers. Its first run already found bugs in the connection check, fixed here too.

Changes

  • test/memos.test.js: uses the same PebbleKit JS stubs as pkjs.test.js, but talks to a real Memos server (MEMOS_URL). On a fresh server it creates the first user and a personal access token through the API, then plays through the watch actions:

    • checking the connection after saving the settings, with a wrong token and with the right one
    • creating memos, the recent list, a single memo, tags and memos by tag, search
    • writing and listing comments, the comment marker on the memo
    • appending a task and ticking it off, pinning, archiving and deleting
    • at the end: no 5xx responses, and it logs the API paths used
  • .github/workflows/memos.yml: a new workflow that starts Memos as a Docker service container, as a matrix:

    • neosmemo/memos:stable, the newest release (Memos publishes no latest tag)
    • neosmemo/memos:0.31.0, the last release before the move to /api, for the fallback in the other direction

    It runs on push and pull requests, by hand, and every Monday (17 6 * * 1). The weekly run catches a breaking Memos release even when nothing changes here. On failure the job prints the server log.

  • README: how to run the test locally against Docker.

The setup follows Memos' own scripts/release_smoke_test.sh: first user via POST /users, sign in via /auth/signin, /api or /api/v1 depending on the version. The token comes from POST /users/{user}/personalAccessTokens, which is the same in 0.31.0 and 26.11.0.

Bugs fixed in the connection check

  • A wrong token was reported as "Connected to Memos". Memos treats an invalid token as an anonymous request, and with public memos the memo list still answers 200. The connection check after saving now asks auth/me, which needs a valid token in 0.31 and 26.x. The integration test found this.
  • "Test connection" on the settings page never worked against Memos. Clay opens the settings page as a data: URL, so its requests have the origin null. Memos never allows that origin for CORS, on purpose: server/cors.go, in 0.31.0 and 26.11.0. The page can't read any answer, and the test always ended with "Could not test from this page". On top of that it asked /api/v1/memos only. Changes:
    • The button is now "Check server" (in all five languages). It only checks, with a no-cors request to the server URL, whether the server answers at all.
    • The hint under the token says that the watch checks it after saving.
    • Browsers may block requests from such a page to the local network (Private Network Access), so a server at home can fail here and still work from the watch. The message for an unreachable server says so.
    • README and store/description.md describe the new behavior; store/settings/en-1-connection.png shows the new button.
  • The mock server in test/pkjs.test.js now answers auth/me, and the tests check the new texts.

Tests

  • CI is green, including both new jobs, and the test runs through to "ALL OK" on both servers:
    • Memos 26.11.0: API paths used /api/v1/ and, after the 410, /api/
    • Memos 0.31.0: only /api/v1/
  • The "Check server" button, checked by hand in Chromium with the real settings page as a data: URL:
    • empty URL → asks for the URL
    • https://github.com → "reachable"
    • a domain that doesn't exist → "not reachable"
    • a URL without a scheme → "not reachable"
    • a server on 127.0.0.1: Chromium blocks the request with the Private Network Access message, as expected
  • Not tested in the phone apps' real web views.
  • node test/pkjs.test.js, node test/i18n.test.js and the clang-format check pass locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ

A new workflow starts Memos in Docker, the newest stable release and
0.31.0 from before the API moved to /api, and runs test/memos.test.js
against it: create, list, tags, search, comments, tasks, pin, archive
and delete as the watch requests them. It also runs once a week, so a
breaking Memos release shows up without a change here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ
Memos treats an invalid token as an anonymous request, and with public
memos the list of memos still answers 200, so a wrong token was
reported as connected. auth/me needs a valid token in Memos 0.31 and
26.x. The test button on the settings page still asked /api/v1 only and
failed with 410 on Memos 26.10 and later; it now falls back to /api like
the requests from the watch.

Found by the integration test against real Memos servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ
The settings page is a data: URL, so its requests have the origin
"null", which Memos never allows for CORS: the page could not read any
answer, and the test always ended with "could not test from this
page". The button, now "Check server", only checks with a no-cors
request whether the server answers. The hint under the token says that
the watch checks the token after saving. Browsers may block requests
from the page to the local network, which the message for an
unreachable server mentions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ
@minils
minils merged commit e482495 into main Nov 7, 2026
10 checks passed
@minils
minils deleted the claude/memos-integration-test branch November 9, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants