Juan Fernando CastroandDaniel Salazar 768b52c10e refactor(push): push database and key names are written once, and the desktop reads its push record through puter.js (#4653)
* 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>
2026-11-16 09:06:23 -07:00
2026-09-25 21:48:15 -04:00
…
2026-09-25 21:48:15 -04:00
2026-11-15 21:30:34 -05:00

Puter.com, The Personal Cloud Computer: All your files, apps, and games in one place accessible from anywhere at any time.

The Open-Source Internet Computer!

« LIVE DEMO »

Puter.com · App Store · AI Builder · Developers · X

screenshot


Puter

Puter is an advanced, open-source, self-hostable internet computer designed to be feature-rich, fast, and highly extensible.

For Users

Puter's goal is to provide you with every app and feature you need to work, create, and play under one roof. From a simple Notepad and Voice Recorder to Spreadsheet and Camera, Puter wants to be the all-in-one solution for your digital life.

For Developers

Puter provides everything you need to build and publish web apps and games. From AI to Cloud Storage and Database to Serverless Workers, Puter has you covered. Puter also helps you get users! Once you build your app, you can publish it on our App Store to reach and monetize users.


Getting Started

💻 Local Development

git clone https://github.com/HeyPuter/puter
cd puter
npm install
npm start

→ This should launch Puter at http://puter.localhost:4100

To run this checkout with Docker, follow Building from source. Create a local docker-compose.override.yml to select the local build; keeping these settings out of docker-compose.yml avoids conflicts when pulling updates and keeps local configuration out of pull requests.


🚀 Self-Hosting

Linux/macOS

curl -fsSL https://puter.com/selfhost | sh

Windows

irm https://puter.com/selfhost?os=windows | iex

→ For more details, see Self-Hosting Puter.


☁️ Puter.com

Puter is available as a hosted service at puter.com.


Support

Connect with the maintainers and community through these channels:

We are always happy to help you with any questions you may have. Don't hesitate to ask!


License

This repository, including all its contents, sub-projects, modules, and components, is licensed under AGPL-3.0 unless explicitly stated otherwise. Third-party libraries included in this repository may be subject to their own licenses.


Translations

Languages
TypeScript 62.3%
JavaScript 34.9%
CSS 1.6%
HTML 1.1%