Skip to content

Keep the desktop app offline, with no Rotur - #111

Merged
Mistium merged 2 commits into
developfrom
desktop-offline
Oct 2, 2026
Merged

Mistium merged 2 commits into
developfrom
desktop-offline

Conversation

@Mistium

@Mistium Mistium commented Oct 2, 2026

Copy link
Copy Markdown
Member

Sophie wants the desktop app offline first, with no Rotur. This takes Rotur out of desktop builds of the editor and leaves the web editor as it is.

One check

hasRotur() in src/lib/rotur/availability.js is false in the desktop app (window.EditorPreload exists, or the page isn't on http or https). The entry points ask it:

  • The Rotur client (client.js):

    • getAccessToken and restoreSession return null, even with a session or old token stored from before;
    • login throws rotur_offline;
    • ensureScopes returns false.

    Everything else in the client already does nothing while signed out, so nothing reaches api.rotur.dev or opens Rotur's socket. Without a Rotur token there's no mistwarp-api session either.

  • The Rotur bridge for projects (RoturExtensionHost.call and ensureConsent) rejects with "Rotur isn't available in the MistWarp desktop app, which works offline." The host stays installed, so the Rotur extension never falls back to its own SDK client.

  • The game host treats every project as unsaved. Saves stay in the editor, and the game shop is the existing test-purchase preview, which charges nothing.

  • The UI hides:

    • the sign-in button and the sign-in modal;
    • Products and Game Items, which are payments;
    • Project history (pushed history on Rotur Git) and Live Collaboration.

    The chat, notifications and My Stuff buttons, sharing to MistWarp, and the reconnect offer already hide themselves when nobody is signed in.

Screenshots

The editor dev server with a stub window.EditorPreload and an old Rotur token in storage.

Desktop: no Sign in:
Desktop editor

Desktop Project menu, without Project history or Live Collaboration:
Desktop project menu

Web, unchanged:
Web project menu

Desktop Edit menu, without Products or Game Items:
Desktop edit menu

Web, unchanged:
Web edit menu

Requests to rotur.dev while loading the desktop editor with that old token:

  • develop: 6, including /v2/me and /v2/auth/check;
  • this branch: 0.

Testing

  • rotur-desktop-offline.test.js is new. With EditorPreload set and an old session and token stored, it checks that:
    • nothing is restored and no token is handed out;
    • signing in and asking for permissions fail;
    • the bridge refuses projects;
    • no request or socket goes to rotur.dev.
  • The Rotur, community and menu suites pass (91 tests), and ESLint is clean on the changed files.
  • Firefox: the web editor has the same menus and Sign in as before. The desktop app runs on Electron, which is Chromium. With the stub EditorPreload, Firefox throws a React "Should not already be working" error, and develop does the same.

Not here

The desktop app (window.EditorPreload, or no web origin) now has no Rotur
at all. hasRotur() in lib/rotur/availability.js is the one check:

- The Rotur client never restores a session or old token there, never
  hands out a token, and refuses to sign in or ask for permissions, so
  nothing reaches api.rotur.dev.
- The Rotur bridge answers projects with a clear 'not available' error.
- The sign-in button and modal, Products, Game Items, Project history and
  Live Collaboration are hidden. Signed-out community features already
  hide themselves.

The web editor is unchanged.
Saves stay local and the game shop is the test-purchase preview, so a
project opened in the desktop app never pays or reaches mistwarp-api.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6fe4e82
Status: ✅  Deploy successful!
Preview URL: https://4f958b64.scratch-gui.pages.dev
Branch Preview URL: https://desktop-offline.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit ceb2357 into develop Oct 2, 2026
2 checks passed
@Mistium
Mistium deleted the desktop-offline branch October 15, 2026 21:45
mc20000-01 pushed a commit to mc20000-01/scratch-gui that referenced this pull request Nov 7, 2026
Keep the desktop app offline, with no Rotur
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.

1 participant