Commit Graph

58 Commits

Author SHA1 Message Date
Eric Bailey 590281f44f Clarify logic, add comment 2026-07-02 09:59:58 -05:00
Eric Bailey 0d22614904 Move GPS link 2026-07-02 09:49:46 -05:00
Eric Bailey f023e34bca Add location to NoAccessScreen, move around GPS request 2026-07-01 16:25:09 -05:00
Eric Bailey 6f6c21d349 Update NoAccessScreen CTA 2026-07-01 15:56:41 -05:00
Eric Bailey ff10228fb6 More flag cleanup 2026-07-01 10:34:51 -05:00
Eric Bailey d8c84057ea Gate age signals by platform and version 2026-07-01 10:28:18 -05:00
Eric Bailey f16e680ffd Add allowsDeviceVerification flag 2026-07-01 10:14:38 -05:00
Eric Bailey 888832a291 Adjust toasts 2026-06-30 10:31:28 -05:00
Eric Bailey c0714be0ec Fix region key symmetry 2026-06-30 10:22:26 -05:00
Eric Bailey 369cf5edd3 Merge remote-tracking branch 'origin/main' into app-1715
* origin/main: (43 commits)
  Release Prep 1.126.0 (#11015)
  Fix chat input positioning on mobile android (#11013)
  Disable selectable profile description on Android (#11002)
  Fix CI - grant workflows permission for internal sync push (#11010)
  Set apple team id via environment variable (#11008)
  Fix 149/150 user limit for starter packs (#11001)
  Nightly source-language update
  Fix GrowthBook exposure did mis-attribution across account switches (#11000)
  Add advanced search UI (#10992)
  Fail video duration check before compression (#10999)
  Add app language: Czech (`cs`) (#10994)
  Clean up type/lint errors in `modules` (#10996)
  Bump actions/download-artifact from 7.0.0 to 8.0.1 (#10971)
  Nightly source-language update
  Change dialog label and header from 'Invite Friends' to 'Share Profile' (#10987)
  Add placeholder, empty-value, and onConfirm support to DateField (#10993)
  Add video upload telemetry events (#10991)
  Hide autocomplete suggestions when input loses focus (#10989)
  Increase unread cap to 99+ (#10985)
  Add icon to AppLanguageDropdown (#10977)
  ...
2026-06-29 19:32:08 -05:00
Eric Bailey d683a03a86 Bump @atproto/api to 0.20.23, drop temporary AA config types
0.20.23 ships `additionalVerificationMethods` on the generated
ConfigRegion type, so the client-side AgeAssuranceConfigRegion
intersection and AgeAssuranceVerificationMethod alias are no longer
needed. Read the field directly off the generated type and type the
debug config as AppBskyAgeassuranceDefs.Config.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 19:26:18 -05:00
Eric Bailey fc7aefc2b4 Rename to additionalVerificationMethods, assume KWS always supported
Model only the methods permitted *in addition to* the always-supported
KWS flow, rather than a full method list. This prevents a region from
being configured as device-only, which would lock out web and any
platform without the native age API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:50:28 -05:00
Eric Bailey d7f3ba36f0 dry up cta 2026-06-29 18:30:42 -05:00
Eric Bailey 69f6a21119 Update device-verification flow comments to match behavior
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:29:01 -05:00
Eric Bailey 4c60eae9e2 Debug edits 2026-06-29 18:22:11 -05:00
Eric Bailey b7975edd12 Toast device verification outcomes on NoAccessScreen
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:18:32 -05:00
Eric Bailey 5374374cb3 Open KWS dialog from device-verification fallback link
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:06:18 -05:00
Eric Bailey 6e00832bb5 Document future silent device-signals refresh path
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 17:34:13 -05:00
surfdude29 90c010e98a Tweak strings and context (#10928) 2026-06-24 11:39:12 -05:00
Eric Bailey 4e808872d4 Rename device-signals debug flag to useMockDeviceSignalsAPIResponse
Invert the flag's polarity and name so it reads like the other "enable"
booleans in the debug module: useMockDeviceSignalsAPIResponse defaults to
true (mock the native response), set false to hit the real API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 10:54:24 -05:00
Eric Bailey 2bfc1e6166 Add TX device-verification region to debug config
Add a US-TX region to the debug config with verificationMethods
['device', 'kws'], plus a useRealDeviceSignalsAPI escape hatch (default
off) so the real native age API can be exercised in debug mode instead of
the faked deviceSignals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:33:06 -05:00
Eric Bailey 18f8d360cb Return an object from device-signals age data helper
Rename getAssuredAgeFromDeviceSignals to getAgeAssuranceDataFromDeviceSignals
and return an object instead of a bare number, leaving room to derive more
rule-engine inputs from the native response (declared vs. guardian-declared,
parental controls, platform verification status) as the rules grow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:06:52 -05:00
Eric Bailey 425505b5ec Show loading state on Verify button during device age prompt
While the native OS age prompt is up, swap the Verify button icon for a
Loader and disable it to prevent double-taps. Scoped to the device path;
the KWS fallback opens a dialog synchronously.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:58:04 -05:00
Eric Bailey 6b94b68690 Store device signals as region-keyed map, resolve to current region
Persist on-device age signals client-side as a map keyed by
country[-region] string, so multiple regions can each retain their own
grant. Reads resolve to the user's current region via mergedGeolocation
(react-query `select` for the hook, a shared helper for the out-of-band
path), so a grant captured in one region never unlocks another.

- AgeAssuranceDeviceSignals is now a region-keyed map
- setDeviceSignalsForRegion merges a region's signals into the map
- useDeviceSignalsQuery select-resolves to the current region; cache
  keeps the full map for the writer + persistence
- getAssuredAgeFromDeviceSignals takes the already-resolved signals

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:31:38 -05:00
Eric Bailey 85f6031708 Bind device age assurance to its origin region, add KWS fallback
Device assurance can't be verified server-side (the OS gives only age
bounds, no signed attestation), so it's persisted client-side only. Bind
each cached grant to the region it was captured in so a TX grant can't
unlock another region.

- Add AgeAssuranceDeviceSignals (signals + originRegion); store the
  region-tagged record in the persisted cache instead of the raw response
- getAssuredAgeFromDeviceSignals now requires the current region to match
  the capture region
- Gate the native age request to native platforms (web returns a
  misleading default); web/new-device/declined falls back to KWS
- TX allows ['device', 'kws'] so the fallback path is real

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:38:51 -05:00
Eric Bailey e834167f81 Integrate on-device age verification into access decision
Wire the expo-age-range device signals (already plumbed) into the age
assurance access decision, gated per-region.

- Model verificationMethods on region config (AgeAssuranceConfigRegion)
  and add a debug US/TX region permitting the 'device' method
- Add region accessors + getAssuredAgeFromDeviceSignals in util
- Surface deviceSignals through the AA context and feed lowerBound in as
  assuredAge, matching the existing IfAssuredOverAge rules
- NoAccessScreen "Verify now" now prompts the OS in device regions and
  falls back to the KWS dialog when unavailable/insufficient
- Keep useDeviceSignalsQuery disabled so we never prompt on load; restore
  from the persisted cache only

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:21:47 -05:00
Eric Bailey 4b7abf0ff2 Add patch 2026-06-22 17:50:13 -05:00
Eric Bailey e06c95e2f0 WIP 2026-06-22 17:47:38 -05:00
Samuel Newman 84c4223ff9 [Chat] Gate group chats for under-18 users (#10548)
Co-authored-by: Eric Bailey <git@esb.lol>
2026-06-09 06:31:22 -07:00
Eric Bailey 690b8184a1 Refactor age assurance flags and contexts (#10794) 2026-06-08 15:34:51 -05:00
surfdude29 a5a6293467 Tweak location strings (#10518) 2026-05-26 10:51:58 -05:00
surfdude29 dc62ce2fb0 Fix "under 18" admonition being incorrectly shown on Moderation screen (#10521)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Eric Bailey <git@esb.lol>
2026-05-26 10:51:48 -05:00
Samuel Newman ff731849b0 Migrate from Yarn 1 to pnpm (#10465)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Eric Bailey <git@esb.lol>
2026-05-18 09:51:04 -07:00
DS Boyce 8c2e4c6fad Write chat declaration record in response to different events (#10216)
Co-authored-by: Eric Bailey <git@esb.lol>
2026-04-20 15:39:12 -05:00
DS Boyce 75c9e2c181 Upgrade eslint-plugin-simple-import-sort to latest (#10260) 2026-04-15 11:00:34 -07:00
Samuel Newman 5d0b900719 Fix server state query returning undefined (#10232)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:14:21 -05:00
DS Boyce d0d00ba9f8 Address lint warnings (#10188) 2026-04-08 15:54:43 -07:00
Eric Bailey 317ce2b3da Prep 1.119.0 (#10062) 2026-03-17 16:16:01 -05:00
DS Boyce 9c9970f680 Don't show chat notification if viewer is age gated (#10042) 2026-03-12 11:21:57 -07:00
DS Boyce 7b5d5a4f76 Provide age-restricted viewers the option to delete their account (#10041) 2026-03-12 11:13:23 -07:00
Samuel Newman 9ec06971af Upgrade Lingui to v5 (#9905) 2026-02-23 20:28:03 +00:00
Samuel Newman 4f1d4821c5 Speed up startup by persisting some queries (#9594)
* persist startup queries

* Use IDB for query storage (#9687)

* Add storage abstraction for persisted query data

Introduce a platform-specific storage abstraction layer for react-query
persistence:
- Native: Uses MMKV for high-performance synchronous storage
- Web: Uses IndexedDB via the `idb` library for efficient async storage

This replaces the previous AsyncStorage implementation with more performant
platform-native solutions. The abstraction maintains API compatibility with
@tanstack/query-async-storage-persister.

* Refactor storage abstraction to use factory pattern

Change createPersistedQueryStorage to a factory function that accepts a
storage ID, allowing multiple isolated storage instances:
- Native: Each instance gets its own MMKV store
- Web: Each instance gets its own IndexedDB database

Adopt the factory pattern in:
- react-query.tsx: Uses 'persisted_queries' storage
- ageAssurance/data.tsx: Uses 'age_assurance' storage

This provides better separation between different query client caches
and allows each to be managed independently.

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Refactor to use archival storage

(cherry picked from commit a773b40e41c96f821cd32260919ce1437c0fc3ab)

* Improve archive db types

(cherry picked from commit 80e4959ba2aa00c984c26aed2f7dfae1095720b0)

* rm idb

* clear on logout, bust on app version

* create abstraction for persisting queries, make gcTime infinite

* Rm abstraction

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Eric Bailey <git@esb.lol>
2026-02-02 11:55:01 -06:00
Eric Bailey 25a1ed1209 [APP-1782] Analytics migration (#9734)
* WIP

* Clean up growthbook code, integrate into init and sessions

* Move everything out of React

* Add metrics client

* Move to separate file

* Shared metadata cache

* Ensure we update metadata when session ID changes

* Ensure userMetadata is cleared when logging out

* WIP revamp

* Integrate feature gates into analytics context

* Clean up old code

* Fix useMeta util

* Some comments and cleanup

* Add logger to base analytics context

* Refactor current route handling

* Rip out LogEvent from navigation

* Update tracking endpoint

* Migrate toClout

* Clear out statsig client

* Add todo, reset logger readme

* Ope fix statsig noop

* Refactor logging in feed-feedback, add debug logging to metrics client

* Remove LogEvents alias for Metrics

* Prefer root package export

* Remove Metrics alias from logger

* [APP-1782] Migrate to new analytics APIs (#9735)

* Migrate logEvent to useAnalytics

* Migrate logger.metric to useAnalytics

* Migrate tricky spot, fix types

* Migrate remaining tricky spot

* Missed one

* Remove metric() from logger

* Migrate useGate to useAnalytics

* Remove all other StatSig mentions

* Update event payload

* Update logger tests

* Mock expo method

* Fix session ID bug

* Add session ID test

* Add test for metrics client

* Clarify intent

* Clean up core analytics file

* Clean up the call once utils

* Fix TODO

* Fix TODO

* Fix TODO

* Fix TODO

* Fix TODO

* Remove debug code

* Fix navigation context

* OK nav context is not working, todo

* Checkpoint: works but feels hacky

* Fix navigation context issue

* Improve feature API

* Improve metric logging

* Update logger tests
2026-01-22 15:33:45 -06:00
Eric Bailey 0589bd7d9e Move /platform/detection vars into /env (#9707)
* Add platform vars to env

* Replace /platform/detection with /env
2026-01-16 16:28:17 -06:00
Eric Bailey 367eebe600 Reset default AA debug for E2E (#9705) 2026-01-15 13:05:11 -06:00
Eric Bailey b3f775d1d8 [AAv2] Improve minimum age handling (#9650)
* Improve miminum age handling

* Update api sdk

* Fix bad import
2026-01-08 15:36:26 -06:00
Eric Bailey a1857d62bd Handle AA config failure (#9660)
* Clarify some comments

* Add error state in case of config failure

* Add retry button and relayout to accommodate
2026-01-08 14:35:43 -06:00
Eric Bailey a355eedf85 Improve instructions on NoAccessScreen and bday dialog (#9571) 2025-12-18 11:05:39 -06:00
Eric Bailey f45e58e057 [AAv2] Add blurb for orgs (#9556)
* Add blurb for orgs

* Update
2025-12-15 14:38:05 -06:00
Eric Bailey d3923c1f2e Move Takendown and Deactivated screens out to the shell alongside AA (#9538) 2025-12-11 13:28:50 -06:00