Python path: None title crashes the loop; bad privacy rule action crashes; invalid privacy rules fail open
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, python
- Ambito
- desktop
Direzione di ricerca
Start in main.py at heartbeat_loop: the transform_window call sits outside the try, and both it and research_filter.transform assume a string title. Reproduce with the three snippets, then read printAppStatus.jxa (only undefined is mapped, not null), compile_privacy_rules (the unhashable action), and the swift branch that refuses to start when rules are configured — that branch is the model for failing closed. Done means non-string titles are coerced, invalid rules are skipped without crashing, and a maintainer has answered whether main() should exit when len(compiled) < len(raw).
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Three crash/fail-open cases in the Python path. Each is reproduced on master 76b3f6f with the snippet shown.
1. A None title crashes the loop. transform_window runs outside the try in heartbeat_loop (main.py), so an exception there ends the watcher.
transform_window({"app": "Finder", "title": None}, exclude_titles=[re.compile("x")]) # TypeError
research_filter.transform({"app": "Google Chrome", "title": None}, {"a": "b"}) # AttributeError
printAppStatus.jxa only replaces title === undefined. An AXTitle that is null would pass through as "title": null. I haven't confirmed that on a Mac, so treat the input source as plausible; the crash itself is certain. A likely fix is to also map null in the JXA, and/or coerce a non-string title to "" before the transforms.
2. A non-string privacy action crashes at startup instead of being skipped. The docstring promises invalid rules are "skipped with an error log":
compile_privacy_rules([{"pattern": "x", "action": ["drop"]}]) # TypeError: unhashable type: 'list'
3. An invalid privacy rule fails open. A rule with a bad regex (e.g. a stray () or an unknown action is logged and skipped, and the watcher then sends unfiltered titles on Linux, Windows and jxa/applescript. The swift branch refuses to start when any rule is configured "so titles are not leaked". An invalid exclude_titles regex also exits (try_compile_regex). Should main() exit when len(compiled) < len(raw)? That is a behaviour change, so I'm asking rather than opening a PR.
- Lingua principale
- Python
- Stelle
- 133
- Fork
- 92
- Merge medio
- 5g 3h
- PR unite (30g)
- 4
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ActivityWatch/aw-watcher-window
-
[macos] Accessibility permission prompt reappears every ~10s even after granting accessForse già presa @StreamOfRon l’ha presa 57 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ActivityWatch/aw-watcher-window#163 · 1 commento ·
-
[macos] Swift helper never appears in the Accessibility list on its own; users must manually dig out the helper binaryForse già presa @StreamOfRon l’ha presa 57 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
ActivityWatch/aw-watcher-window#123 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
ActivityWatch/aw-watcher-window#119 · 1 commento ·
Tutte le issue di ActivityWatch/aw-watcher-window
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Pantheon-Security/medusa#24 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
docs(notation): the ipa_to_arpa section does not name the tied and non-syllabic diphthong formsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
TigreGotico/scriptconv#445 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
TigreGotico/phoonnx#1045 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni