Skip to content

Commit 6fa5de6

Browse files
authored
Merge pull request #435 from ImShyMike/fix-missing-category
2 parents 3f9e7b5 + 8ed27ee commit 6fa5de6

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ GEM
108108
bindex (0.8.1)
109109
bootsnap (1.18.6)
110110
msgpack (~> 1.2)
111-
brakeman (7.0.2)
111+
brakeman (7.1.0)
112112
racc
113113
builder (3.3.0)
114114
bullet (8.0.8)

app/controllers/api/hackatime/v1/hackatime_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ def handle_heartbeat(heartbeat_array)
236236

237237
parsed_ua = WakatimeService.parse_user_agent(heartbeat[:user_agent])
238238

239+
# if category is not set, just default to coding
240+
heartbeat[:category] ||= "coding"
241+
239242
# special case: if the entity is "test.txt", this is a test heartbeat
240243
if heartbeat[:entity] == "test.txt"
241244
source_type = :test_entry

lib/test_wakatime_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class TestWakatimeService
44
def initialize(user: nil, specific_filters: [], allow_cache: true, limit: 10, start_date: nil, end_date: nil, scope: nil, boundary_aware: false)
55
@scope = scope || Heartbeat.all
6-
# trusting time from hackatime extensions.....
6+
# trusting time from hackatime extensions.....
77
# @scope = @scope.coding_only
88
@scope = @scope.with_valid_timestamps
99
@user = user

0 commit comments

Comments
 (0)