Peewee explicit event IDs can move events between buckets

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 10 days

@TimeToBuildBob is already working on this.

Since Oct 28, 2026.

  • #196 by @TimeToBuildBob — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python, sqlite
Domain
backend, database

Research direction

Start by tracing Peewee event storage and the repository’s storage regression tests; the issue does not name specific files or tests. Reproduce the single-object and mixed-batch cases with disposable SQLite databases, then inspect how aw-server handles the resulting HTTP error. Done means foreign-bucket IDs are rejected without mutation while same-bucket replacement, ID-less inserts, heartbeat behavior, and existing nonexistent-ID behavior are preserved.

Written by the indexing model from the issue text.

Description

Posting an event with bucket A’s existing ID into bucket B updates the globally identified Peewee row and moves it out of A. Reproduced on master c7821899 using disposable SQLite databases through the Python HTTP API: both single-object and one-element batch requests return 200, A becomes empty, and B contains the overwritten row.

Expected: reject a foreign-bucket ID without mutating either bucket. Mixed batches must reject before applying earlier updates/inserts. Preserve same-bucket replacement, ID-less inserts, and heartbeat behavior. Establish existing nonexistent-ID behavior rather than changing insertion policy across backends.

Scope: Peewee ownership preflight plus repository storage regressions; HTTP error handling will be verified against aw-server. No personal history or live service was used.

Dominant language
Python
Stars
65
Forks
74
Avg merge
7d 7h
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ActivityWatch/aw-core

All issues in ActivityWatch/aw-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.