REPLACE endpoint for more reliably replacing events

Open
#115 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
api, backend

Research direction

Start by reviewing the existing /insert endpoint and the linked aw-server-python PR #57. Define the /replace endpoint's behavior for missing event IDs and batches, including how failure is reported; done means the API reliably distinguishes successful replacements from missing events.

Written by the indexing model from the issue text.

Description

enhancement

So it's already possible to replace events by setting the "id" property in the /insert endpoint.

So why would you want to have a separate /replace endpoint?

  • Because /insert does not fail if the "id" does not exist, it creates a new event
  • If one out of many replaces in /insert fails we have no idea what actually happened, we need to do fetch the events after to be certain which should be unnecessary
  • Any other reasons, put a comment below and I'll add it to this list

I don't think this is a high priority task right now, might be in the future if we get a use-case which replaces a lot of events.

Resources:

Dominant language
Rust
Stars
322
Forks
105
Avg merge
3d 10h
Merged PRs (30d)
22

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-server-rust

All issues in ActivityWatch/aw-server-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.