Return structured 400 when event storage rejects a foreign-bucket ID

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

I maintainer di solito rispondono entro 5 giorni

@TimeToBuildBob ci sta già lavorando.

Dal 28/10/2026.

  • #214 di @TimeToBuildBob — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Start at EventsResource.post, where event creation errors become HTTP responses, and inspect the Peewee HTTP tests. Add regression coverage for single, one-element, and mixed batches, supported writes, and failed-write cache behavior; verify invalid writes return structured InvalidEvent 400 while storage failures remain server errors. The issue reports linked core work and unchanged stored events during reproduction; pull request #214 is already open.

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

Descrizione

Companion to ActivityWatch/aw-core#195. Peewee currently accepts a supplied ID belonging to another bucket and moves the row. The core repair rejects it with ValueError before mutation, but EventsResource.post does not map write-time ValueError, so the HTTP response becomes 500.

Expected: catch invalid event-write ValueError at the event creation HTTP boundary and return structured InvalidEvent 400; preserve storage failures that are not input errors as server failures. Add disposable Peewee HTTP regressions for single/one-element/mixed batches, unchanged source/destination events, supported updates/inserts/heartbeats and failed-write cache behavior.

Reproduced on server master 994ea988 with repaired core worktree; both single and one-element batch return 500 while leaving stored events unchanged. No live data/listeners used.

Lingua principale
Python
Stelle
129
Fork
104
Merge medio
5g 14h
PR unite (30g)
15

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 ActivityWatch/aw-server

Tutte le issue di ActivityWatch/aw-server

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.