Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with bucket name start by aw- #1120

Closed
2 tasks done
e471wo opened this issue Dec 23, 2024 · 2 comments
Closed
2 tasks done

issue with bucket name start by aw- #1120

e471wo opened this issue Dec 23, 2024 · 2 comments
Labels
invalid Nothing to fix, not an actual bug, etc. type: bug

Comments

@e471wo
Copy link

e471wo commented Dec 23, 2024

  • I am on the latest ActivityWatch version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • linux mint:

  • last one:

Describe the bug

trying to do a watcher by myself, I found that if the bucket name bucket_id start by "aw-" all data are erased from the gui (not db).

To Reproduce

  1. Start and use Activitywatch as normal (and having data)
  2. create a new watcher with a bucket name start by aw- (see the code below )
  3. in the activity tab, you only have the watcher you created, all others deseapeard.

Here the code that does bug.
Note, to see data again, just delete the bucket.

#!/usr/bin/env python3

from time import sleep
from datetime import datetime, timezone

from aw_core.models import Event
from aw_client import ActivityWatchClient

client = ActivityWatchClient("test")
bucket_id = "{}_{}".format("aw-test", client.client_hostname)
print(bucket_id)
event_type = "currentwindow"
client.create_bucket(bucket_id, event_type=event_type)
with client:
    sleeptime = 1
    for i in range(5):
        heartbeat_data = {"app": "vlc", "title":"audio stream"}
        now = datetime.now(timezone.utc)
        heartbeat_event = Event(timestamp=now, data=heartbeat_data)
        print("Sending heartbeat {}".format(i))
        client.heartbeat(bucket_id, heartbeat_event, pulsetime=sleeptime+1, queued=True, commit_interval=4.0)
        sleep(sleeptime)

Expected behavior

dunno... but not that. Actually, I don't know what the issue is. why aw- is an issue.

Documentation

after normal use
image

after the script ran.
image

Copy link

Hi there!
As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct.
Thanks a bunch for opening your first issue! 🙏

@ErikBjare
Copy link
Member

Right, because you now have two buckets with the currentwindow type for the same hostname, which is not valid.

@ErikBjare ErikBjare closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2024
@ErikBjare ErikBjare added the invalid Nothing to fix, not an actual bug, etc. label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Nothing to fix, not an actual bug, etc. type: bug
Projects
None yet
Development

No branches or pull requests

2 participants