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

[TUI] One unreadable profile file blinds kept_key(): strata launch silently mints a NEW API key

Aperta Adatta ai principianti
#4,396 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@Nyarlathoteppppp ci sta già lavorando.

Dal 29/10/2026.

  • #4563 di @Nyarlathoteppppp — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia da kept_key() in strata_cli/launch/access.py (intorno alla riga 342), dove il ciclo legge row["source_config"] e il catch-all intorno alla riga 352 restituisce None. Controlla come profiles.list_profiles() in strata_cli/profiles.py (intorno alle righe 178-179) costruisce le righe di errore senza quella chiave, e confrontalo con il .get("source_config") difensivo di updater.py:718. Il lavoro è completo quando un file di profilo danneggiato costa solo la propria riga e la chiave esistente continua a essere restituita quando un altro profilo contiene api_key.

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

Descrizione

Problem: kept_key() (strata_cli/launch/access.py:342) indexes row["source_config"] for every launch profile, but profiles.list_profiles() returns {"id", "error"} rows — without that key — for every profile file that fails to load (strata_cli/profiles.py:178-179). The KeyError is swallowed by the catch-all at access.py:352 (except Exception: return None), so the WHOLE key lookup dies, not just the bad row. apply_defaults then does s.api_key = kept or access.new_key() — exactly what the function's own docstring exists to prevent ("the key an earlier launch already made, so a restart does not invalidate the apps set up with it"). Note updater.py:718 reads the same rows defensively with .get("source_config") — this loop does not.

Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag)
OS: Linux x86-64
Runtime: Python 3.14
Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own.

Reproduce (measured at function level): three launch profiles, one damaged (echo 'NOT JSON' > ~/.config/strata/profiles/launch-bad.json), another carrying api_key in its run config: kept_key() returned None; after deleting only the damaged file it returned the stored key. End-to-end: strata launch --preset <existing> --access lan --no-tui would mint a fresh key (not run here: it would download; the branch is measured).

Expected: a damaged or foreign profile costs at most its own row; the existing key is kept.
Actual: the lookup dies, a new key is minted, and every app configured with the old key gets 401 until someone re-runs strata launch --show-key.

Reproduction status: measured at function level; end-to-end untested.

Lingua principale
C++
Stelle
11.6k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 Niko1221/Strata

Tutte le issue di Niko1221/Strata

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.