Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

DREAMCODER_CONFIG_DIR does not isolate webview storage on macOS

Aperta
#177 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
linux, macos, tauri, typescript
Ambito
desktop, devtools

Direzione di ricerca

Read desktop/src-tauri/src/main.rs:16-20 and check whether the current Tauri version supports WebviewWindowBuilder::data_directory on macOS and Linux. Trace how DREAMCODER_CONFIG_DIR is set and how restoreTabs in desktop/src/stores/tabStore.ts reads localStorage; compare the available data-directory approach with namespacing localStorage keys. Done means isolated runs keep separate webview state on supported platforms, with the issue's tab restoration behavior verified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:desktop bug

Problem

DREAMCODER_CONFIG_DIR is meant to isolate a run's data, but on macOS (and Linux) the webview storage is not isolated. desktop/src-tauri/src/main.rs:16-20 puts the webview data under <config dir>/EBWebView by setting WEBVIEW2_USER_DATA_FOLDER. Only WebView2 on Windows reads that variable. WKWebView on macOS keeps using ~/Library/WebKit/<app>, so every dev run shares one localStorage, whatever config directory it uses.

What it causes

Open tabs are restored from localStorage (restoreTabs in desktop/src/stores/tabStore.ts). Session tabs are kept only when their session exists, but the Scheduled tab is always kept. Starting a dev app with a fresh DREAMCODER_CONFIG_DIR therefore drops every session tab, because none of those sessions exist in the new directory, and lands on the Scheduled page. It happens on every start with a new config directory. Other localStorage state such as drafts or UI preferences leaks between isolated runs the same way.

The release app is not affected, because it uses a different storage directory and origin than the dev build. Portable mode on macOS has the same gap.

Possible fix

Give the webview a data directory under the config directory on every platform when DREAMCODER_CONFIG_DIR is set, for example through Tauri's WebviewWindowBuilder::data_directory. Check what that API supports on macOS with the current Tauri version first. If it is not supported, an alternative is to namespace the localStorage keys by config directory.

If #174 (moving to Electron) goes ahead, this should be solved there instead: give the Electron session a partition or userData path under the config directory.

Lingua principale
TypeScript
Stelle
490
Fork
47
Merge medio
10h 53m
PR unite (30g)
81

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GoDiao/dreamcoder

Tutte le issue di GoDiao/dreamcoder

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.