Skip to content
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

presence detection callback #2048

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
37b48ce
make presence detection call back part of krypto wrap
James-Pickett Jan 14, 2025
69d13cf
appease linter
James-Pickett Jan 14, 2025
17b95f9
dont do presence detect on linux
James-Pickett Jan 15, 2025
607aae4
more testing, comments
James-Pickett Jan 16, 2025
63de88e
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 16, 2025
87eb256
fix parallel tests
James-Pickett Jan 16, 2025
ae3df3f
fix data race
James-Pickett Jan 17, 2025
3313df0
handle not having session id
James-Pickett Jan 21, 2025
33b281b
unify presence detection timeout across all components
James-Pickett Jan 21, 2025
d88a4cb
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 21, 2025
ccc0d2f
darwin tags on c code
James-Pickett Jan 21, 2025
2f2e4bb
fix linux detect func
James-Pickett Jan 21, 2025
3776151
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 21, 2025
50a98a0
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 24, 2025
93544fa
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 24, 2025
89947f3
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 27, 2025
400ecb4
send presence detection callbacks on interval
James-Pickett Jan 28, 2025
1afdd2d
fix linux tests
James-Pickett Jan 28, 2025
1d44a3e
make tests clearer
James-Pickett Jan 28, 2025
76ebb8a
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 28, 2025
5a683ba
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 30, 2025
f806cf4
split out osme helpr funcs to make wrap more readable
James-Pickett Jan 30, 2025
c4859df
feedback from pr review
James-Pickett Jan 30, 2025
947fc17
comments, code simplification
James-Pickett Jan 30, 2025
bad7164
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 30, 2025
64ddff7
remove unused file, update logging level
James-Pickett Jan 31, 2025
fcab9ca
Merge branch 'main' into james/presence-detection-callback
James-Pickett Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ee/desktop/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (r *DesktopUsersProcessesRunner) DetectPresence(reason string, interval tim
var lastErr error

for _, proc := range r.uidProcs {
client := client.New(r.userServerAuthToken, proc.socketPath)
client := client.New(r.userServerAuthToken, proc.socketPath, client.WithTimeout(presencedetection.DetectionTimeout))

durationSinceLastDetection, err := client.DetectPresence(reason, interval)
if err != nil {
Expand Down
14 changes: 13 additions & 1 deletion ee/desktop/user/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ type client struct {
base http.Client
}

func New(authToken, socketPath string) client {
type clientOption func(*client)

func WithTimeout(timeout time.Duration) clientOption {
return func(c *client) {
c.base.Timeout = timeout
}
}

func New(authToken, socketPath string, opts ...clientOption) client {
transport := &transport{
authToken: authToken,
base: http.Transport{
Expand All @@ -47,6 +55,10 @@ func New(authToken, socketPath string) client {
},
}

for _, opt := range opts {
opt(&client)
}

return client
}

Expand Down
1 change: 1 addition & 0 deletions ee/localserver/krypto-ec-middleware-helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package localserver
James-Pickett marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading