Hauk icon indicating copy to clipboard operation
Hauk copied to clipboard

Hauk Android client keeps sharing previously stopped sessions

Open eras opened this issue 3 months ago • 2 comments

I've been working on an alternative backend for Hauk to provide tag-based sharing for a group trip, and I noticed the following behaviour in the network traffic:

client.49276-server.08080: POST /api/post.php HTTP/1.1
Accept-Language: en
Content-Type: application/x-www-form-urlencoded
User-Agent: Hauk/1.6.2 Dalvik/2.1.0 (Linux; U; Android 16; Pixel 8 Build/BP2A.250705.008)
Host: server:8080
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 89

acc=11.367&prv=1&lon=XXX&time=1.756705873414E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.49276: HTTP/1.1 404 Not Found
content-length: 18
access-control-allow-credentials: true
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
date: Mon, 01 Sep 2025 05:51:10 GMT

Session not found.
client.49282-server.08080: POST /api/stop.php HTTP/1.1
Accept-Language: en
Content-Type: application/x-www-form-urlencoded
User-Agent: Hauk/1.6.2 Dalvik/2.1.0 (Linux; U; Android 16; Pixel 8 Build/BP2A.250705.008)
Host: server:8080
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 20

sid=mB748hxnRB9n6vco
server.08080-client.49282: HTTP/1.1 200 OK
content-length: 3
content-type: text/plain
access-control-allow-credentials: true
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
access-control-expose-headers: content-type
date: Mon, 01 Sep 2025 05:51:14 GMT

OK

Abbreviated subsequent traffic log entries (note some of the requests use the same sid mB748hxnRB9n6vco):

client.55100-server.08080: POST /api/post.php HTTP/1.1
acc=11.437&prv=1&lon=XXX&time=1.756705893426E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.55100: HTTP/1.1 404 Not Found

client.44694-server.08080: POST /api/post.php HTTP/1.1
acc=11.435&prv=1&lon=XXX&time=1.756705913472E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.44694: HTTP/1.1 404 Not Found

client.38364-server.08080: POST /api/post.php HTTP/1.1
acc=11.44&prv=1&lon=XXX&time=1.756705933444E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.38364: HTTP/1.1 404 Not Found

client.38376-server.08080: POST /api/post.php HTTP/1.1
acc=11.44&prv=1&lon=XXX&time=1.756705933453E9&lat=XXX&sid=mB748hxnRB9n6vco
server.08080-client.38376: HTTP/1.1 404 Not Found

client.60414-server.08080: POST /api/post.php HTTP/1.1
acc=11.494&prv=1&lon=XXX&time=1.756705953495E9&lat=XXX&sid=mB748hxnRB9n6vco
server.08080-client.60414: HTTP/1.1 404 Not Found

client.60428-server.08080: POST /api/post.php HTTP/1.1
acc=11.494&prv=1&lon=XXX&time=1.7567059535E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.60428: HTTP/1.1 404 Not Found

client.60630-server.08080: POST /api/post.php HTTP/1.1
acc=11.435&prv=1&lon=XXX&time=1.75670597352E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.60630: HTTP/1.1 404 Not Found

client.60636-server.08080: POST /api/post.php HTTP/1.1
acc=11.435&prv=1&lon=XXX&time=1.756705973523E9&lat=XXX&sid=mB748hxnRB9n6vco
server.08080-client.60636: HTTP/1.1 404 Not Found

client.37514-server.08080: POST /api/post.php HTTP/1.1
acc=11.473&prv=1&lon=XXX&time=1.756705993577E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.37514: HTTP/1.1 404 Not Found

client.37522-server.08080: POST /api/post.php HTTP/1.1
acc=11.473&prv=1&lon=XXX&time=1.75670599358E9&lat=XXX&sid=mB748hxnRB9n6vco
server.08080-client.37522: HTTP/1.1 404 Not Found

client.49920-server.08080: POST /api/post.php HTTP/1.1
acc=11.483&prv=1&lon=XXX&time=1.756706013536E9&lat=XXX&sid=XELGsqLrc9S0Vl5h
server.08080-client.49920: HTTP/1.1 404 Not Found

client.49936-server.08080: POST /api/post.php HTTP/1.1
acc=11.483&prv=1&lon=XXX&time=1.756706013537E9&lat=XXX&sid=mB748hxnRB9n6vco
server.08080-client.49936: HTTP/1.1 404 Not Found

So there are two problems:

  • When Hauk Android client is requested to stop sharing, and the stop.php endpont is invoked, it still keep sharing
  • It also keeps sharing all the previous sessions (of that run)

Those previous sessions are being run also after starting a new session. So it seems perhaps some sharing thread is not properly terminated? Presumably there is no support for multiple concurrent shares.

I do get the "Sharing ended" dialog box in the Android client.

Usually this would be difficult to notice, because the client terminates the sharing session, which ignores the updates for stopped sessions, so nothing happens in the map.. But in principle the server does keep receiving the location information, and could keep track of it, even when the user thinks the session is terminated.

Naturally stopping Hauk client will stop and forget the sessions.

eras avatar Sep 01 '25 04:09 eras

Oops, I had revised the logs too much, it didn't show the stop.php invocation. Edited the original message.

eras avatar Sep 01 '25 05:09 eras

I did notice that the extraneous sharing inverval is larger than configured sharing interval, so perhaps it's not a thread but a location callback that hasn't been unregistered that causes this.

eras avatar Sep 01 '25 06:09 eras