From 845f8e4423883ef6251640cd428279ad52ed869d Mon Sep 17 00:00:00 2001 From: ShyMike <122023566+ImShyMike@users.noreply.github.com> Date: Wed, 23 Jul 2025 23:36:55 +0100 Subject: [PATCH 1/3] fix missing category --- app/controllers/api/hackatime/v1/hackatime_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/api/hackatime/v1/hackatime_controller.rb b/app/controllers/api/hackatime/v1/hackatime_controller.rb index 66c7708..db4b401 100644 --- a/app/controllers/api/hackatime/v1/hackatime_controller.rb +++ b/app/controllers/api/hackatime/v1/hackatime_controller.rb @@ -236,6 +236,9 @@ class Api::Hackatime::V1::HackatimeController < ApplicationController parsed_ua = WakatimeService.parse_user_agent(heartbeat[:user_agent]) + # if category is not set, just default to coding + heartbeat[:category] ||= "coding" + # special case: if the entity is "test.txt", this is a test heartbeat if heartbeat[:entity] == "test.txt" source_type = :test_entry From ec3cc503219828010a98fb65547c967f54f1e152 Mon Sep 17 00:00:00 2001 From: ShyMike <122023566+ImShyMike@users.noreply.github.com> Date: Wed, 23 Jul 2025 23:40:22 +0100 Subject: [PATCH 2/3] fix trailing whitespace --- lib/test_wakatime_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_wakatime_service.rb b/lib/test_wakatime_service.rb index 2c630c7..9db8f7e 100644 --- a/lib/test_wakatime_service.rb +++ b/lib/test_wakatime_service.rb @@ -3,7 +3,7 @@ include ApplicationHelper class TestWakatimeService def initialize(user: nil, specific_filters: [], allow_cache: true, limit: 10, start_date: nil, end_date: nil, scope: nil, boundary_aware: false) @scope = scope || Heartbeat.all - # trusting time from hackatime extensions..... + # trusting time from hackatime extensions..... # @scope = @scope.coding_only @scope = @scope.with_valid_timestamps @user = user From 8ed27ee805dff53cb878a4ce958057b1e2ad34b9 Mon Sep 17 00:00:00 2001 From: ShyMike <122023566+ImShyMike@users.noreply.github.com> Date: Wed, 23 Jul 2025 23:52:46 +0100 Subject: [PATCH 3/3] update brakeman this should fix the failing check --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2340089..d0baf7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,7 +108,7 @@ GEM bindex (0.8.1) bootsnap (1.18.6) msgpack (~> 1.2) - brakeman (7.0.2) + brakeman (7.1.0) racc builder (3.3.0) bullet (8.0.8)