Bucket DELETE ignores ?force=1: aw-server-rust deletes without it (Python refuses with 401)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
Direzione di ricerca
Inizia da bucket_delete in aw-server/src/endpoints/bucket.rs, che non accetta il parametro force, e confrontalo con il controllo del aw-server Python che restituisce 401 a meno che non sia in modalità test o non ci sia ?force=1. Esegui la riproduzione con curl su entrambi i server per confermare la differenza. È completato quando una DELETE senza ?force=1 viene rifiutata al di fuori della modalità test, e aw-webui e aw-client-js risultano inviare force=1.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
DELETE /api/0/buckets/<id> on aw-server-rust deletes the bucket and all its events without ?force=1. The Python aw-server refuses the same request outside testing mode, and the docs say force=1 is required (REST reference, "Delete").
This matters because clients rely on the guard. aw-client's delete_bucket(bucket_id, force=False) sends ?force=1 only when you pass force=True. On aw-server-rust, the default call is irreversible.
Repro (v0.14.3 linux release, normal mode, isolated XDG_* dirs):
aw-server-rust --port 5651 & # and the bundled Python aw-server on 5652
for p in 5651 5652; do
curl -s -o /dev/null -X POST -H Content-Type:application/json \
-d '{"client":"t","type":"t","hostname":"h"}' http://127.0.0.1:$p/api/0/buckets/vb
curl -s -w " <- DELETE without force: %{http_code}\n" -X DELETE http://127.0.0.1:$p/api/0/buckets/vb
curl -s -o /dev/null -w "GET after: %{http_code}\n" http://127.0.0.1:$p/api/0/buckets/vb
done
<- DELETE without force: 200 # aw-server-rust
GET after: 404 # bucket and events are gone
{"message": "Deleting buckets is only permitted if aw-server is running in testing mode or if ?force=1"}
<- DELETE without force: 401 # Python aw-server
GET after: 200
?force=0 also deletes on aw-server-rust. bucket_delete in aw-server/src/endpoints/bucket.rs takes no force parameter at all.
Expected: the same guard as Python: refuse without ?force=1 unless the server runs with --testing.
One compatibility point to check first: whether aw-webui and aw-client-js send force=1 when deleting a bucket from the UI. If they don't, they need the parameter in the same change.
Found during a docs-vs-reality pass of the REST API docs (ActivityWatch/docs#224).
- Lingua principale
- Rust
- Stelle
- 322
- Fork
- 107
- Merge medio
- 2g 16h
- PR unite (30g)
- 25
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-server-rust
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
ActivityWatch/aw-server-rust#872 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ActivityWatch/aw-server-rust#798 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
query: categorize rules can pin unbounded memory in the regex cache and run past query_timeoutForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
ActivityWatch/aw-server-rust#893 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
aw-client CLI ignores aw-client.toml host/portForse già presa @TimeToBuildBob l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
ActivityWatch/aw-server-rust#888 ·
I maintainer di solito rispondono entro 1 giorno
-
aw-sync status calls the daemon's live staging db orphaned and safe to deleteForse già presa @TimeToBuildBob l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
ActivityWatch/aw-server-rust#887 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ActivityWatch/aw-server-rust
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kashsuks/Pinel#172 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 1 giorno
-
test_a_503_raises_unavailable_error fails on macOS about one run in sixForse già presa @naman-modi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
userFRM/egui-charts#4168 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno