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) 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 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