goals

Reset Goal Browser Session

Changed on

Start over: this browser gets a new session, and so a new conversation.

Field-found on the voice e2e (#1947): there was no way to begin again. GET /goals/session keeps a live cookie's session on purpose — that is what makes a conversation survive a reload — GET /goals/conversation resumes the durable one, and nothing rotated either, so "new goal" could only navigate back to the same conversation forever.

Unsafe, taking the same three signals every unsafe goals route takes, because from the athlete's point of view this ends their conversation: a cross-site page that could reach it could throw away work somebody is in the middle of. The answer is shaped exactly like the bootstrap's — replacement cookie, fresh CSRF token, the new session's id and expiry — so a client swallows it with the code it already has for GET /goals/session.

The old goal session is left to its TTL rather than deleted; :meth:~cheshire.resources.browser_sessions.BrowserSurface.rotate says why.

Every goal this browser settled stays its own (#3070). A goal is owned by the browser rather than by the session that settled it, and the new session carries the browser forward, so the owner's reads, the hand-off to the app and revise all keep answering after a start over. Only the conversation is new (wonderland goals.md: an athlete who starts a fresh goal keeps every goal they settled before).

An active voice conversation is not this route's business. The audio is held between the browser and the voice service, so nothing here could end one; the client hangs up first, and a conversation left running would only be delegating turns onto a session its own page no longer holds.

The app starts over on its bearer (#2635). An install's uid resolves one session, so what rotates there is the uid itself: the next request from the install lands in the new conversation, and the answer carries no cookie and no CSRF token, like the bootstrap's bearer answer. Every goal the install settled stays in its account, where the app, the coach and the plan read it. Two resets from one install at once race for the uid, and the loser is a 409.

post/goals/session/reset

Request

  • Base URL
    https://api.imperfect.co (the document declares no server; this is the origin it was published from)
  • URL
    https://api.imperfect.co/goals/session/reset
  • Auth
    HTTP bearer

Headers

x-device-timezonestring nullable
x-device-hintstring nullable
x-client-platformstring nullable

Response

Successful Response

session_idstring required
expires_atstring date-time required
reachable_channel'whatsapp' | 'texts' nullable
linkable_channelsstring[]
csrf_tokenstring nullable
recoveredboolean
custom_tokenstring nullable

Changes

    • warning

      removed the optional property //// from the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property // to the response with the status