Repository navigation
Test the phone-side JS against real Memos servers in the CI - #18
Merged
Merged
Conversation
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
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.
The move of the Memos API from
/api/v1to/apiin Memos 26.10 (#15) only showed up on a user's watch. The mock server intest/pkjs.test.jscan'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 aspkjs.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:.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 nolatesttag)neosmemo/memos:0.31.0, the last release before the move to/api, for the fallback in the other directionIt 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 viaPOST /users, sign in via/auth/signin,/apior/api/v1depending on the version. The token comes fromPOST /users/{user}/personalAccessTokens, which is the same in 0.31.0 and 26.11.0.Bugs fixed in the connection check
200. The connection check after saving now asksauth/me, which needs a valid token in 0.31 and 26.x. The integration test found this.data:URL, so its requests have the originnull. 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/memosonly. Changes:no-corsrequest to the server URL, whether the server answers at all.store/description.mddescribe the new behavior;store/settings/en-1-connection.pngshows the new button.test/pkjs.test.jsnow answersauth/me, and the tests check the new texts.Tests
/api/v1/and, after the 410,/api//api/v1/data:URL:https://github.com→ "reachable"127.0.0.1: Chromium blocks the request with the Private Network Access message, as expectednode test/pkjs.test.js,node test/i18n.test.jsand the clang-format check pass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01MMvmJrU1E3NywbJFFfVYSZ