* refactor(push): the database and key names are written once for the page and both workers
pushNames.js holds the puter-push database name, its stores, key prefixes
and the subscription-changed message. pushStore.js re-exports them.
push-sw.js and the GUI's sw.js are served as they are (push-sw.js also
from npm's src/), so neither can import the module. Each carries a block
generated from pushNames.js by tools/pushWorkerNames.mjs. The puter.js
webpack build and the GUI build fail while either block is stale, and a
test compares the names in both worker sources with the page module's.
* refactor(push): the desktop reads the confirmed endpoint and the mark through puter.js
puter.js now records the endpoint the server confirmed, and clears the
subscription-changed mark, inside the Puter GUI as on a website. Three
internal methods give the desktop what it kept itself: _webPushRecord()
reads both, _noteWebPushSynced() records an endpoint a status check
confirmed, and _dropRemovedWebPush() ends a removed subscription and
forgets its receipt and the mark.
webPushClient.js no longer opens the puter-push database or keeps its
own localStorage record. An endpoint an earlier build kept there is read
while puter.js has none, and removed once puter.js records one, so an
already synced browser keeps its status without registering again. With
a puter.js that lacks the methods, the client reads nothing from it and
keeps the old record.
* refactor(push): one-line comments on the push names and the record methods
* fix(push): the worker names check reads CRLF checkouts, lives in tools/ and runs in PR CI
The block helper moves to tools/pushNamesBlock.mjs, so it isn't part of
the published puter.js sources. It compares and rewrites on LF text and
writes back the file's own line endings. Both workers are pinned to LF
in .gitattributes. The puter.js tests run when the GUI's sw.js or its
build changes, and the GUI build checks sw.js before anything else.
* fix(push): the desktop keeps a removed browser off with a puter.js that has no push record
The desktop loads puter.js from its own URL, so it can run one without
_webPushRecord(). The client then uses pushStore.js's helpers itself: it
reads and clears the subscription-changed mark, ends a removed
subscription and forgets its receipt and the mark, clears the mark after
enable(), and keeps the confirmed endpoint in localStorage as before.
_noteWebPushSynced() resolves whether it recorded the endpoint, and the
localStorage endpoint is removed only after puter.js has it. A cached
status reads only the mark before answering. The accessors carry JSDoc
types.
* fix(push): the removed-elsewhere check also asks about the endpoint in localStorage
When loads alternate between puter.js versions, localStorage can hold a
newer confirmed endpoint than puter.js does. The background check now
asks about both, with the mark's old endpoint, before registering.
* fix(push): with an older puter.js the desktop also asks about the endpoint puter.js recorded
Once puter.js has recorded the confirmed endpoint, the desktop drops its
localStorage copy. A later load that runs an older puter.js then read
neither, so a browser that lost its subscription after being removed in
Puter could register again. The fallback now reads puter.js's record from
the store directly.
* refactor(puter-js): the push record reads use try/catch instead of .catch()
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
* ci: take release-please from its current home
google-github-actions/release-please-action is archived: the action
moved to googleapis/release-please-action, same code, same inputs,
same major version, and that is where the fixes now land. The
release-please workflow references the maintained repository.
* ci: declare what the three unscoped workflows may do with the token
Docs Build, Maintain Release Merge PR and Notify HeyPuter had no
permissions block, so they ran with the repository's default token
scope. Docs Build only checks out and builds, Notify HeyPuter only
calls the dispatch endpoint with its own token: both declare
contents: read. Maintain Release Merge PR pushes the
auto-update/release branch and opens the release pull request, so it
declares contents: write and pull-requests: write. The other
workflows already declared their scopes and are left as they are.
* ci: stop persisting the checkout credentials in the jobs that never push
actions/checkout keeps the job token in the clone's git config, where
every later step can read it. Twelve checkouts now set
persist-credentials: false: the backend and puter.js test jobs, the
coverage jobs, the type checks, the docs build, the AI provider tests
and the Docker image build read the clone and push nothing with git.
The two checkouts of Maintain Release Merge PR keep the token: that
job resets the release branch and pushes it through
create-pull-request.
* ci: lock the workflow actions to the commits they resolve to
GitHub's workflow dependency lockfile holds the commit each action
reference resolves to, transitive actions included, and the runner uses
those commits even if a tag moves later. .github/workflows/actions.lock
comes from gh actions-lock (v0.4.1), which also narrowed every reference
to the exact release it locked, so Dependabot keeps bumping versions and
its security alerts keep matching. Re-run the same command after adding
or bumping an action.
* ci: drop the unused token scope from Notify HeyPuter, match workflow indentation
* ci: remove the disabled release workflows
release-please and Maintain Release Merge PR have been disabled since 2024; releases are cut from calver tags. Their entries leave the lockfile with them.
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
- lowerDecoratorsPlugin dropped esbuild's source map, so coverage and
stack traces reported transformed lines. Pass the external map through.
- puter.js node runner kept a ~6 MB `__coverage__` per vm context and ran
out of heap. Contexts now share one object; workerd merges as it goes.
report-coverage skips its comparison when the PR leg failed.
- CI-only test/hook timeouts of 20 s / 60 s.
- setupTestServer disables the database-liveness health check, whose
`SELECT 1` landed in query-counting tests.
- LocalWorkerService.shutdown asserts the timer shutdown arms instead of
the global fake-timer count.
- userHandlers worker test waits for posts by label.
- AppStore stats test pins the clock so rows don't cross midnight UTC.
- Realtime backpressure test waits up to 5 s for holds to settle.
The base leg checked out the base branch from the PR's head repo. For a
fork PR that is the fork's copy of main, which can predate the current
Node version and fail npm ci.
* chore: move to Node 26
Docker image and CI run on Node 26 (bookworm-slim, same Debian base as before).
Node 26's bundled undici reads the global dispatcher from the
`undici.globalDispatcher.2` slot, so the guard's 10-minute timeout wrap on
`.1` no longer reached plain fetch() and provider calls fell back to the
5-minute headers timeout. The guard now wraps every present slot and tracks
wrapped dispatchers in a set, since compose() can return a Proxy that writes
a marker property through to the original dispatcher.
* test(puter-js): disable Node's web storage in test workers
Node 26 defines its own localStorage global, undefined without a storage
file, and vitest's jsdom environment doesn't replace globals that already
exist, so jsdom tests saw localStorage as undefined.
Skipping the whole matrix job via a job-level `if` collapses it to a
single check with the unevaluated name template ("test (\${{
matrix.artifact }})") instead of expanding to "test (base)"/"test (pr)",
since there's no matrix context to fill in when the job never runs. That
check never matches a required-status-check pinned to "test (pr)", so
PRs that skip backend/puterjs testing block forever waiting on a check
that will never be reported. Gate the steps instead so the matrix always
expands with stable names, doing no real work when irrelevant.
- CODEOWNERS: default owners @Salazareo @ProgrammerIn-wonderland @jelveh
@jfcastro92, plus @reynaldichernando for src/docs.
- dependabot.yml: ignore semver-minor/major npm updates, patch only.
- backend-tests.yaml / puterjs-tests.yaml: trigger unconditionally and gate
the real work behind a dorny/paths-filter job instead of a workflow-level
path filter, so the checks always report (skipped when irrelevant) and
can be marked required. Also pins matrix job names to the artifact label
instead of the branch ref, which previously made the check name change
per PR and unusable as a required check.
Changes are:
- global egress metering
- remove file egress cost
- introduce file op cost for the per request cost s3 has
- enforce fs read/download etc to through 402 when out of usage; allow for subdomains
- enforce kv metering when out of usage through 402; allow for workers
- jsdoc as source of truth for puter.js types
- kv driver caching for get and batchget operations with decreased costs
* test: tests for puter.js
* fix: ship lockfile for coverage devDeps; tolerate missing base coverage
npm ci failed on CI because package.json gained the babel/istanbul
devDependencies without the matching package-lock.json update. Also make
the coverage workflow's base leg best-effort so a base ref that predates
the coverage script reports without the comparison column instead of
failing the run.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>