Repository navigation
fix: take a yes for the terms at app sign-in instead of a version - #1385
Conversation
The app had to send the exact version in force or sign-in failed with a 422. A version in the app is fixed when it's built, so raising the version would lock out every installed build. The value also did nothing: acceptance is recorded as a timestamp and compared with the version. The app now says terms_accepted, and the time we record stands for the version in force. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The phone sent a hard-coded terms version and the server refuses anything but the one in force, so the 1 November terms update would have made sign-in fail with a 422, and every later update would do the same to builds already installed. The server now takes a yes (dev-null-sh/dev-null.sh#1385) and works out the version from when it hears. Both Client methods always send it. A sign-in can't start without the tick, and reading the tick when the sign-in finishes lost it whenever the browser's answer landed on a new onboarding screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… terms change (#82) * Ask people to agree to the terms and privacy policy before they sign in Neither Sign in with GitHub nor Sign in with Apple works until the box is ticked, and links open the terms and privacy policy in the app's browser. The phone tells devnull which version it showed as it signs in (terms_version), which devnull records. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Say the terms were accepted instead of naming a version The phone sent a hard-coded terms version and the server refuses anything but the one in force, so the 1 November terms update would have made sign-in fail with a 422, and every later update would do the same to builds already installed. The server now takes a yes (dev-null-sh/dev-null.sh#1385) and works out the version from when it hears. Both Client methods always send it. A sign-in can't start without the tick, and reading the tick when the sign-in finishes lost it whenever the browser's answer landed on a new onboarding screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Ask for terms that changed before anything else, and show them in Settings When devnull says the terms in force haven't been accepted, the app now opens on a screen that asks for them, like the web's terms dialog. Launch goes straight there when the last answer said so, and any /me answer that says so sends you there from whatever screen you're on. Accepting sends the version /me named, so terms that change again while the screen is open get a 422 and are asked for again. Sign out and Delete account are the other ways out. Account settings gets a Terms and privacy section just before Delete account: links to both pages in the in-app browser, and the version in force beside the one you agreed to and when. devnull only keeps when you accepted, so an older version shows as "an older version" rather than a date. Sign out and delete account move into a LeavesDevnull concern so the new screen can share them with Settings, and the two page links into OpensLegalPages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Say which terms you accepted in one sentence in Settings The current, agreed to and accepted rows put two version names and one acceptance day side by side, all as dates, and agreed to always matched current because the terms screen takes over when they differ. One sentence says it plainly: "You accepted the terms of Nov 1, 2026 on Nov 3, 2026." Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Simon <simon.hamp@me.com>
The app's sign-in screen asks people to accept the terms, then tells us when it redeems its code. Until now it had to send
terms_version, and anything other than the exact version in force got a 422.That doesn't work for an app. Its version is fixed when it's built, so raising
legal.terms_versionwould stop every installed build from signing in until people update. The 1 November terms change has already moved the version past the one in the unmerged app PR, NativePHP/dev-null-app#82. The value wasn't used either: we recordterms_accepted_atasnow()and compare that with the version.POST /api/v1/devicesnow takesterms_acceptedas a boolean instead. The app links to the live terms and privacy pages and carries no copy of them, so the person accepted whatever was in force at that moment. The recorded time already says which version that is.What to check:
terms_version, because Improve commit star #82 is the first app change to use it. If one did, the field would now be ignored rather than refused, and acceptance wouldn't be recorded.PUTfor accepting from a signed-in session still takes the version, for the app and the web. Those clients read it from the server just before sending, so they can't go stale and I left them alone.terms_acceptedfor Apple as well, so that path needs to record it once feat: link and sign in with Apple from the API #558 lands.This should merge before #82. If #82 ships first, sign-in still works but acceptance isn't recorded until this is deployed.
Device, terms and current user API tests pass, along with Pint, Rector and PHPStan on the changed files. I didn't run the full suite.
🤖 Generated with Claude Code
Summary by CodeRabbit