Skip to content

feat: add optional always-active-pattern to canonical queries #543

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented Aug 23, 2025

No description provided.

The serialize_classes function was using serde_json serialization which
caused regex patterns to be double-escaped (e.g., 't\.co' became 't\.co'),
breaking pattern matching in ActivityWatch queries.

Core changes:
- Rewrite serialize_classes() to build JSON strings manually instead of using serde_json
- Preserve single-escaped regex patterns for proper matching
- Only include 'ignore_case' field when true (omit when false)
- Only include 'regex' field for non-'none' type categories
- Improve error handling in classes deserialization
- Add optional fields to ClassSetting struct for better compatibility
This fixes the core regex pattern matching issues in ActivityWatch
canonical queries that were causing incorrect categorization results.
@0xbrayo
Copy link
Member Author

0xbrayo commented Aug 23, 2025

depends on #541, already built on top of it so, I'll just wait till that is merged first

Copy link

codecov bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.23%. Comparing base (656f3c9) to head (01f2541).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
aw-client-rust/src/queries.rs 73.52% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #543      +/-   ##
==========================================
- Coverage   70.81%   68.23%   -2.59%     
==========================================
  Files          51       54       +3     
  Lines        2916     3132     +216     
==========================================
+ Hits         2065     2137      +72     
- Misses        851      995     +144     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xbrayo 0xbrayo force-pushed the always-active-pattern branch from 3297811 to 01f2541 Compare August 23, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant