[PR #117] Customer App Task 8: The Terms Re-Consent Screen
I requested this work.
- What was done: For the eighth task in the customer app plan, I had Claude build the screen (
/consent) that users see when the terms have changed and they must agree again. The screen loads each term the server lists, shows its text, and enables the “Agree and continue” button only after every term is checked. After sending the agreement, it reloads the list and goes to the app’s home screen only when no terms are left. If a user does not agree, the screen says the app cannot be used, and it also offers sign-out and a contact path. - Choices made:
- The checkboxes do not use a new package. They are built on the basic press component (
Pressable) with the checkbox role, so there is one less dependency to install. - The agree button is enabled only when every text has loaded, every box is checked, and no send is in progress. A double tap (pressing the same button quickly several times) still sends one request.
- If the server answers with an “outdated terms” error (
consent_document_stale), the screen shows the new terms with the boxes cleared, without blaming the user. Other failures, such as a network error, show only “Please check your connection and try again,” and the boxes stay as they are. The user is not signed out. - Each time the list is fetched, a number is increased, so a slow old response cannot overwrite a newer list.
- Instead of each screen handling a “consent required” reply (
403 consent_required), the shared request helper sends the user to/consentin one place. If the sign-in state changed during the request, it does not redirect. - There is one loading message above the screen. Giving every term its own message would make the screen reader announce several of them, which is confusing.
- The checkboxes do not use a new package. They are built on the basic press component (
- How it was checked:
- Before building, I ran the tests so I could see them fail, since the screen and its logic did not exist yet. After the build, the two related test files, 11 tests in total, passed. The test files themselves were not changed.
- The app’s type check (confirms that data types match) and lint (checks for code mistakes and style) reported zero errors, and 116 tests in 14 app test files passed.
- The cloud session had no Docker (a tool that runs the server for tests), so the full
verifyrun, which includes the server tests, could not finish locally. The GitHub CI checks (automated checks on every change),verifyande2e, both passed. - I added a line to the test setup (
src/test/setup.ts) that replaces a phone-only Kakao login module with an empty fake (a mock). Outside a phone, that module does not exist, so the tests failed right at the start.
| Item | Details |
|---|---|
| What was built | The re-consent screen (/consent), loading the list and terms text, one send for agreement |
| What it prevents | Duplicate sends from repeated taps, an old response overwriting a newer list, reaching app screens without agreeing |
| Checks | 11 tests passed, 116 app tests passed, zero type-check and lint errors, CI verify and e2e passed |
Who did what
- Me: I requested the work.
- Fizz (GPT-6 Luna): wrote the tests before the build.
- Claude (cloud session, Claude Sonnet 5.5): built the screen and its logic.
- PL (Claude Sonnet 5.5): coordinated the work and organized the PR.
What I learned
- A weak test can pass in the wrong place. Moving the
/consentline outside the route guard (Stack.Protected, the setting that blocks screens depending on sign-in state) still left all eight tests passing. The tests rendered the real sign-in provider, and that provider sends the user to the sign-in screen by itself when no sign-in data is saved. So the result was the same with or without the guard. To check a guard, the test should swap in a fake sign-in provider and check the guard on its own. - The server must publish new terms only after the app can show the screen. If the server publishes a new terms version that requires agreement before this screen reaches the app, the server blocks the app’s requests, but the app has no screen to send the user to. For that reason, the PR description lists this order first.