Phones stay joined: Lax cookie and a kept token to put it back (0.110.2)
Paul, 8 November 2026: the phone kept asking to join again on the same Wi-Fi. The TV never forgot it (two joins today); the phone arrived without its cookie. SameSite=Strict cookies are withheld when the page is opened from another app (a home-screen shortcut, the camera), so the cookie is now Lax; changes still need X-Orbit and an address as Host. The phone also keeps the token (handed over in the #fragment, never sent to the network again) and the join page quietly puts the cookie back via POST /rejoin; wrong tokens count as strikes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,13 @@ class PhoneLinkTest {
|
||||
assertEquals(302, joined.status); val cookie = joined.cookie!!
|
||||
assertEquals(1, phones.size); assertNull(PhoneLink.pairing)
|
||||
assertTrue(call("/join", "POST", "code=${p.code}", form = true).body.contains("run out")) // once only
|
||||
// A phone that lost its cookie (8 November 2026) puts it back from the token it kept; nothing else gets in that way.
|
||||
val token = cookie.substringAfter('=')
|
||||
val back = call("/rejoin", "POST", token, cookie = null)
|
||||
assertEquals(200, back.status); assertEquals(cookie, back.cookie)
|
||||
assertEquals(403, call("/rejoin", "POST", "f".repeat(64)).status)
|
||||
assertEquals(403, call("/rejoin", "POST", "not a token").status)
|
||||
assertFalse(call("/rejoin", "POST", token, orbit = false).body.contains("joined")) // no X-Orbit: just the join page
|
||||
// The API, joined.
|
||||
assertEquals(0, JSONObject(call("/api/channels", cookie = cookie).body).getJSONArray("channels").length())
|
||||
assertEquals("The X-Files", JSONArray(call("/api/suggest?d=90s%20sci-fi", cookie = cookie).body).getJSONObject(0).getString("title"))
|
||||
|
||||
Reference in New Issue
Block a user