Skip to content

Invalid encoding for category filter links from summary view #1051

@AgainPsychoX

Description

@AgainPsychoX
  • I am on the latest ActivityWatch version.

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

  • OS name and version: Microsoft Windows [Version 10.0.19045.4291]

  • ActivityWatch version: v0.12.2 (rust)

Describe the bug

Using link to filter for category from summary view seems to navigate to invalid encoded path: plus (+) signs seems to be an issue. The same goes ampersand (&) character. I didn't test for other for now.

To Reproduce

  1. Launch the ActivityWatcher
  2. Create category with problematic character, like C/C++.
  3. Make up some activity so it's logged.
  4. Go to Activity > Summary > Top Categories.
  5. Click the created category.
    image
  6. You are navigated to .../view/summary?category=[...]>C%2FC%20%20, but no activity is shown ("no data").
    image

Expected behaviour

I expected to find the usual activity log breakdown etc.

Documentation

Whole issue seems to result from invalid URL encoding:

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.
(https://www.w3schools.com/tags/ref_urlencode.ASP)

Let me know if you need any logs or anything, but I don't think its applicable here.

Additional context

Workaround

Aside from obvious "just avoid problematic characters", you can still view activity using manual filter selection:
image

Link changes then to .../view/summary?category=Work>Programming>C%2FC%2B%2B, note the difference %20 and %2B for plus characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions