Skip to content

fix: read every listing page and report HTTP errors - #7

Merged
linghengqian merged 1 commit into
mainfrom
fix/5-6-error-paths-pagination
Nov 18, 2026
Merged

linghengqian merged 1 commit into
mainfrom
fix/5-6-error-paths-pagination

Conversation

@linghengqian

Copy link
Copy Markdown
Member

Fixes #5
Fixes #6

Summary

  • The listing is read to its last page. util:parseReleases follows nextPageToken and percent-encodes the token, so versions listed after the first 1000 prefixes are no longer dropped. A repeated token is reported as an error instead of looping forever.
  • HTTP error statuses no longer make the error handlers concatenate a nil err. err and the status are checked separately, and the message includes the status, for example get version failed: HTTP 503. This covers the version listing, the latest-version file and the checksum.
  • The arm64 error reads dart does not support arm64 architecture. docs/platforms.md and docs/zh-CN/platforms.md quote the corrected text, and the changelog has an Unreleased entry in both languages.

Verification

  • tests/releases_test.lua (new) covers a three-page dev listing with encoded tokens, installing a version that is only on the last page, a repeated token, a page without a prefixes field, HTTP 503 and a transport error for the listing, the checksum and the latest-version file, and the arm64 message.
  • vfox plugin test . with vfox 1.1.0, the version the Test Plugin workflow pins, passes all six test files. On origin/main the new file fails at its first paging assertion.
  • stylua --check . with v2.6.0, as in the Lint workflow, passes. lua-language-server was not run locally.
  • vfox plugin run ... Available against the live Cloud Storage listing gives identical output before and after the change (1283 versions). The current second dev page holds no versions, so the live run does not show the new paging result; the test file does.

parseReleases requested only the first page of the Cloud Storage listing,
so versions listed after the first 1000 prefixes were dropped silently.
It now follows nextPageToken until a response has none, percent-encoding
the token in the query string. A repeated token is reported as an error.

An HTTP error status returns no err from http.get, so the error handlers
concatenated a nil value and failed with a Lua error. err and the status
are now checked separately, and the message includes the status.

The arm64 error message was missing a space. It now reads
"dart does not support arm64 architecture", and the platform pages quote
the corrected text. The changelog gets an Unreleased entry in both
languages.

tests/releases_test.lua covers paging, the repeated-token guard and each
error path.
@linghengqian linghengqian added the bug Something isn't working label Nov 18, 2026
@linghengqian
linghengqian merged commit f632e52 into main Nov 18, 2026
8 checks passed
@linghengqian
linghengqian deleted the fix/5-6-error-paths-pagination branch November 18, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev channel listing ignores nextPageToken Error paths concatenate a nil error, and the arm64 error lacks a space

1 participant