-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
fixed zero-duration bug #40
fixed zero-duration bug #40
Conversation
I kept getting errors when compiling Rust, so I wasn't able to send/retrieve events from the server, I just built everything except for web-ui, and aw-server. I tested everything by logging it in the Therefore, this section needs some extra testing, as I'm not sure if it retrieves the name correctly. val lastEvent = getLastEvent()
if(lastEvent != null) {
var prevEventData = JSONObject(lastEvent.getString("data"))
prevEventAppName = prevEventData.getString("app")
Log.w(TAG, "lastAppName: ${prevEventAppName}")
} |
What were the errors? The only thing needed should be a somewhat recent version of rust nightly. |
@ErikBjare as per the discussion in #39, I removed |
@johan-bjareholt It was either rusqlite, or ring. I tried it again today and it compiled without issues, likely due to the dependancy updates on June 16/17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me,
@ErikBjare what do you think? You know more about this code than I.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Although there might still be issues as discussed in #39 I think we should go ahead and merge this, and then we can compare the stats with SmarterTime/Digital Wellbeing to see how severe the remaining issues are.
Just waiting for Travis to complete and then I'll merge.
@johan-bjareholt Looks like Travis fails when building aw-server-rust, do you have any idea about that?
|
@ErikBjare I have no idea why, works in the aw-server-rust repo and aw-android seems to run a quite recent version of it. On a side note the commit log in this PR looks kind of odd, you should probably squash them or something. |
de9fe91
to
c18ebd3
Compare
Just fixed the commit log. I kept the initial fix in the history of the PR because the approach from it might be useful later, especially since there are still some issues(though much smaller scale now) as discussed in #39 |
c18ebd3
to
bbe44e2
Compare
Rebased on top of master, hoping that fixes Travis. |
It didn't, looks like it could be related to rust-lang/rust#73293 I'll update the dependencies in aw-server-rust and try again. |
Managed to reproduce on latest nightly and fixed by:
|
Yay, CI passing. Merging. |
Fixes #34, #39, and parts of ActivityWatch/activitywatch/issues/440
If event is AFK(screen_non_interactive), it is stored as queuedAfkEvent, and you move on to next item. On next item, if the app name of current event matches event before queuedAfkEvent, then you send new item first, and then the afk event (to allow them to be merged as 1 event by AW), otherwise if they have different names, send queuedAfkEvent first, and then current event