Skip to content

DELETE endpoint to delete event(s) #60

Open

Description

@johan-bjareholt

My suggested API:

  • Remove DELETE <bucketname>/events/<id> endpoint
  • Add POST <bucketname>/events/delete/by_ids
  • Add GET <bucketname>/events/delete/by_period?start=X&end=X

Reasons why the old delete API is bad and should be replaced completely:

  • The new "by_ids" endpoint makes it possible to remove multiple specific events in one go while the old API could only delete one event at a time.
  • The old DELETE endpoint is also broken because both /events/<id> and /events/count are in the same namespace

Things which need to be considered:

  • Vacuuming the database

Resources:

Activity

  1. changed the title [-]DELETE endpoint to delete event[/-] [+]DELETE endpoint to delete event(s)[/+] on Aug 27, 2019
  2. ErikBjare commented on Aug 28, 2019

    @ErikBjare
    Member

    We should keep in mind that we might want to use the pragma secure_delete or run a VACUUM to ensure secure deletion of data.

  3. johan-bjareholt commented on Aug 28, 2019

    @johan-bjareholt
    MemberAuthor

    Maybe run VACUUM when aw-server is starting up?
    Seems like a sane time to do it.

  4. johan-bjareholt commented on Aug 28, 2019

    @johan-bjareholt
    MemberAuthor

    secure_delete=FAST seems like the best approach for us I believe.

  5. ErikBjare commented on Aug 28, 2019

    @ErikBjare
    Member

    Maybe run VACUUM when aw-server is starting up?
    Seems like a sane time to do it.

    If the operation is somewhat costly then I'd rather not as that could slow down the startup time of the Android app (less of a concern on desktop, where the user is unlikely to use ActivityWatch the moment it's started).

  6. johan-bjareholt commented on Aug 28, 2019

    @johan-bjareholt
    MemberAuthor

    If the operation is somewhat costly then I'd rather not as that could slow down the startup time of the Android app (less of a concern on desktop, where the user is unlikely to use ActivityWatch the moment it's started).

    Hm, I guess that's true.

    A solution would be to have it as both an API endpoint to manually start a VACUUM as well as maybe store the last time a VACUUM was performed and do it once every X months.

  7. johan-bjareholt commented on Jan 14, 2020

    @johan-bjareholt
    MemberAuthor

    So the delete endpoint for a single event just as for aw-server-python is now implemented but there is no VACUUM for now.
    Maybe we should have a new issue for VACUUM?

  8. johan-bjareholt commented on Apr 5, 2020

    @johan-bjareholt
    MemberAuthor

    Updated the issue body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions