Commit Graph

70 Commits

Author SHA1 Message Date
Ryan Stelly
c2418a15bd halted launch debug tool (#3688)
* __DEV__ ts global and eslint global

* add HaltedLaunch App wrapper with Rozenite Control trigger

* paren spacing
2026-06-05 11:37:47 -05:00
Johannes Klein
86a4a9f23b Update rozenite to 1.10.0 (#3662)
* Update package.json

* Update package-lock.json

* Replace deprecated mmkv- with general storage-plugin
2026-05-28 10:19:42 +02:00
Ryan Stelly
ad62fc104f Add rozenite controls plugin with ff toggle (#3490)
* add controls rozenite plugin

* refactor rozenite config to useRozenite hook

* add TODO comment for lifting up nav rozenite config

* move rozenite controls from devDeps to deps

* switch ff toggle to use..... a toggle : p

* remove temp code disabling logbox
2026-04-03 14:26:05 -05:00
Abbey Campbell
edaa72c765 back to class 2026-03-23 23:25:02 -07:00
Abbey Campbell
073aad8315 change class to plain module 2026-03-19 19:31:00 -07:00
Abbey Campbell
f939a0c6f7 add logging for startup time/time to interactive 2026-03-19 16:55:09 -07:00
Johannes Klein
f1be620752 Add rozenite require profiler plugin (#3349)
* Update package.json

* Update package.json

* Update package-lock.json

* Use tilde

* Update metro.config.js

* Update index.js
2026-02-03 18:13:36 +01:00
Abbey Campbell
8209bbf8e3 remove dark mode 2026-01-20 13:30:07 -08:00
Ryan Stelly
61a555e369 add & config mmkv rozenite devtool plugin (#3317)
* add & config mmkv rozenite devtool plugin

* use new import for explicit storage clearn

* use existing name for zustand mmkv storage and add install data storage to devtool
2026-01-08 13:11:53 -06:00
Ryan Stelly
f0bfefd0b3 integrate rozenite devtool base config & plugins (#3315)
* add base rozenite metro package and configuration

* add and configure React Query rozenite devtools

* add and configure network rozenite devtools

* shift rozenite deps, add README docs

* remove flow tag for root

* fix readme rotentite typo
2026-01-07 14:44:56 -06:00
Ryan Stelly
b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00
Corey Farwell
a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00
Johannes Klein
843fda54e1 Fix: Stringify error contexts (#3081)
* Stringify native error crash data

* Stringify a JWT error crash data

* Stringify mutations error context
2025-08-28 17:03:39 +02:00
Johannes Klein
74b5bfaad2 Remove comment
It does, we can see logs on the server coming from this context.
2025-08-21 13:14:47 +02:00
Amanda Bullington
f8bce67501 Creative day: drawer and tab navigator dark mode (#2945)
* Add dark mode to tab and drawer navigation

* Remove log

* Add color for darkModeGray and make dark mode debug only
2025-06-25 10:00:01 +02:00
Amanda Bullington
95151e065b Remove unused code and packages, add eslint package for TS, suppress TS errors (#2924) 2025-05-28 17:01:10 -07:00
Amanda Bullington
703971356d Improve native error handling; attempt to store crash data in zustand storage then log in servers (#2771) 2025-03-14 12:38:09 -07:00
Ken-ichi
21a66c8580 fix: make UUIDs more random (#2629)
Replaces react-native-uuid with uuid, which might do a better job making UUIDs random
2025-01-21 15:23:15 -08:00
Amanda Bullington
92c5fa243d Add a navigation guard to make sure a user can't navigate to login while offline (#2624) 2025-01-17 19:34:24 -08:00
Ken-ichi
6bc0d0098c fix: update user language on server after changing in app (#2467)
Main fix was updating inaturalistjs to get a recent bug fix. Also submits a
JSON body instead of a pseudo-formdata-style body.

Also:

* Only try to process queued items that have not failed in the last minute
* Delete queued items after failing 3 times
* Fix index.js error handler bug that was squelching errors that weren't
  getting caught by the ErrorBoundary
2024-11-21 13:21:29 -08:00
Ken-ichi
64d07fad35 fix: only show onboarding once per install (#2390)
* refactor: give the install MMKV instance a more accurate name
* refactor: rename install data wrapper, verbify function names
2024-11-07 14:25:25 -08:00
Angie
cd82f8b9fc feat: phone storage full alert (#2157)
* Show alert when device full and user takes photo and when app lauch

* change min device storage limit to 200MB

* add storage full alert to AI camera

* Hook for device storage full

* Changes requested

* Show device stoarge full alert only once on app start
2024-10-03 00:36:25 -07:00
Amanda Bullington
5945ccc525 Fixes and error handling for API throttling (#1971)
* Add new error type for 429; remove unnecessary logs

* Batch API calls for SpeciesSeenCheckmark

* Remove SpeciesSeenCheckmark test

* Revert logging errors

* Use Set for observedTaxonIds

* Add comments around logger.info statements

* Merge linting update

* More fixes from code review

* Switch to non-authenticated useQuery for fetching taxon ids seen by X user id

* Fix tests
2024-08-14 22:08:03 -07:00
Amanda Bullington
65ea27c751 Clear user data on sign out (#1873)
* Clear documents directory & mmkv on signout

* Add code comment

* Rename userData.ts
2024-07-29 13:30:50 -07:00
Johannes Klein
28c27e241a 1785 debug hide (#1837) 2024-07-23 12:30:04 +02:00
Ken-ichi
5c6e88cbc1 Typescrpt path aliases (#1648)
* Typescrpt path aliases;
* Tried to resolve all ts errors in one file
2024-06-05 14:35:49 -07:00
Ken-ichi
7ea60f7b9b Add X-Installation-ID logging (#1608)
* Add X-Installation-ID logging
* Allow logged out logging
* Log whether user has enabled advanced add obs btn
2024-05-24 21:06:20 -07:00
Ken-ichi
08c04ad1ab Improved error reporting for logstash (#1529)
When an Error object is passed to logger.error() as the last arg, this change

* extracts error_type and backtrace
* reports a shorter message that should be searchable

Also:
* Avoid double logging errors; ErrorBoundary should log errors in a way we can parse
* Added restart button to default ErrorBoundary; globalized text
2024-05-13 18:28:56 -07:00
Amanda Bullington
63484b1330 Package updates (#1357)
* Package updates

* Add mocks and update snapshot
2024-04-04 20:57:09 -07:00
Ken-ichi Ueda
f0812a0a83 Log unhandled promise rejections in release builds 2024-03-12 21:34:01 -07:00
Johannes Klein
48fcea1526 359 post logs to internal logging (#1256)
* Made react-native-logs post to API log endpoint

* Try to build a slightly more informative user agent

* Made react-native-logs post to API log endpoint

* Try to build a slightly more informative user agent

* Remove unused const

* Replace other usages of exported user agent

* Revert "Remove unused const"

This reverts commit 02389c8390.

* Revert removal of axios instance

* Strange order

* Remove device name from user agent

* Copy logstash transporter to new file and change to post

* Update import

* Remove comma

* Get the user jwt token as authorization for the log request

* Use anonymous token as app token

* Mock away logs config file because it now has a dependency on authentication

* Code style

* Typo

* Add timestamp field to form data, to show client_timestamp on the logs

* Add TODO

* Add a developer button to force a js-side error

* Add comments

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-03-07 00:04:29 +01:00
budowski
02d8f16883 account settings webview
Replaces account settings with a small set of settings and a web view to show settings on the website.

Also

* Minor taxon detail fixes
* Display taxon name on observations according to the current user's
  preferences, not the observers

Closes #927

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-28 19:34:57 -08:00
budowski
f5fbc3ce11 Return to original screen after canceling photo import
Closes #1051

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-13 16:59:11 -08:00
Johannes Klein
93061bf8de Set user-agent in global config (#1096)
* Update inatjs

* Globally set user-agent for inaturalist js usage

* Remove user-agent from announcements
2024-01-30 15:41:32 +01:00
Ken-ichi
b815f451ea Offline fixes (#1025)
* Changed the default React Query retry handler to be synchronous; being async
  meant it returned a promise, which React Query interpreted as true-ish,
  which meant it retried forever
* React Query retry handler should log info about its query key, which should
  make those problems a bit easier to debug given a log
* Prevent useObservationUpdates from throwing errors when network requests
  fail, which they always do while offline
* Added our own ErrorBoundary that shows a component trace
* Prevent several uses of useAuthenticatedRequest when not online
* Work around bug in vision-camera-plugin-inatvision where it can't get
  dimensions of photos in Android
* Actually throw errors when vision-camera-plugin-inatvision's predictImage
  throws unexpected errors
* Allow online suggestions while signed out using anonymous JWT
2024-01-11 17:18:04 -08:00
Amanda Bullington
cad36a7253 Replace white screen with error boundary component (#983)
* Replace white screen with error boundary component; replace JS exception handler; closes #976

* Code cleanup
2023-12-18 16:34:06 -08:00
Amanda Bullington
808cbee452 Replace ObsEditProvider with zustand for global state management (#948)
* Add zustand to app

* Begin replacing ObsEditProvider with zustand for global state

* Use store and add tests

* Fix bugs

* Add test to check for deleted photos in StandardCamera

* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail

* Fix ObsEditWithoutProvider tests

* Move store to where it's needed

* Fix tests

* Await evidence being added to obsPhotos from camera

* Add a note about slices to useStore
2023-12-05 14:10:00 -08:00
Ken-ichi Ueda
c6b0d62aea Bugfix: another ActivityHeader issue w/ stale react data
Also removed some redundant retry handling in useInfiniteObservationsScroll in
an attempt at better logging, particularly while offline.
2023-12-04 17:39:51 -08:00
Ken-ichi
b51d2983f9 Don't retry queries if the servers return 503 codes (#794) 2023-09-27 15:00:01 -07:00
Ken-ichi Ueda
ee38d76801 New eslint rules 2023-05-17 15:21:35 -07:00
Amanda Bullington
5ee4a433df Add location picker to ObsEdit (#593)
* Crosshairs, location accuracy warnings, text input for location picker

* Add LocationPicker tests

* UI improvements and code refactor into smaller components; get GMaps working

* Add shadows to icons/text boxes

* Use debouncing to avoid map jitter when typing in location

* Show place results & let user pick new location from web api

* Add tests for location picker with remote results

* Add gmaps api key to github actions

* Try adding manifest placeholders for env variable to work in github actions

* Add key to printf in github actions

* Try accessing GMAPS_API_KEY a different way

* Update android e2e env file step

This updates the "Create .env file" step to use printf to print the Google Maps key into a newly created .env file in the GitHub Action runner. Using the same key as in env.example.

* Fix newline

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-04-26 10:51:05 -07:00
Amanda Bullington
fa94ab5b42 ObsEdit - bottom sheets (#570)
* Add KebabMenu to shared components index

* Separate EvidenceList from PhotoCarousel component

* Remove unneeded props from PhotoCarousel

* Create notes bottom sheet

* Fix tests for delete obs sheet

* Add wild status sheet

* Show date from observations uploaded via website

* Move media viewer modal into evidence section

* Fix mock

* Move location fetching into its own hook

* Refactor ObsEdit header; move code into Header component

* Add discard changes sheet

* Styling updates and save changes button

* Add classes to buttons based on evidence/id missing

* Add imprecise location sheet

* Add jest.fn from provider to ObsEdit tests

* Remove fakeTimers from ObsEditWithoutProvider.test.js; minor cleanup

* Show discard obs sheet anytime a user tries to navigate back

* Fixes to bottom sheet backdrop, evidence, add discard changes sheet

* Switch to paper radio buttons instead of checkmarks

* Fix bottom sheet backdrop in android by wrapping with GestureHandlerRootView

* Update bottom sheet for add comment & notes

* Fix test

* Remove fake timer from ObsEdit test to get tests passing

* Force update github actions cache

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-04-20 17:02:19 -07:00
Chris
98a6663fe1 561 fix hidden bottom sheet (#563)
* Show bottom sheet over tab bar

* use present method

* Ensure bottom sheet works elsewhere

* Ensure bottom sheet works elsewhere

* Add provider to test

* lint

* Fix tests

* Merge fixes

---------

Co-authored-by: Amanda Bullington <35536439+albullington@users.noreply.github.com>
Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-04 12:30:07 -07:00
Amanda Bullington
7a98b6faf1 Timeless dates (#457)
* Add DateDisplay to ObsCard and make first pass at translation strings

* Add failing tests (due to lack of localization) for timeless dates

* WIP: trying to ensure i18next gets initialized before tests run

The remaining test failures might be legit. This probably breaks the actual
app, though.

* Got the rest of the tests working

* Updated tests to assume UTC
* Updated README to advise against using `npx jest` so test runs always have
  the env vars we specify in our `npm test` script
* Moved i18next initialization to an explicitly-named file
* Use i18next init function in app
* Fixed up remaining tests

* Added test for non-English localization of date format

* Cleanup

* Made DateDisplay explicitly handle strings not Dates

* Restore skipped localization tests for MyObservations

* Remove duplicative tests from DateDisplay unit test

* Added note to the README about initializing i18next

* Updated change to DateDisplay in main

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-02-14 22:14:38 +01:00
Amanda Bullington
3f125beab6 Framework for adding custom icons to iNatRN (#414)
* Add custom iNat icon font to iOS and Android
* Add custom icon to iNat UI library
* Create custom iNat icons using IconButton for add obs modal & footer
* Add icon placeholders to observation edit screen
* Test fixes for accessibility
* Move paper provider into new component; fix names in UI library
* Update README with clarified directions about changing the name of the .ttf file
2023-01-31 16:45:11 -08:00
Johannes Klein
f8c403b9b1 353 retry with jwt (#382)
* Rename some functions and variables

* Rename function

* Revert to original timeout for tokens

* Get JWT for a 401 or 403 http errors in the react-query QueryClient retry handler

* Log API error to new logger

* Fetch token on every render in useApiToken hook

* Remove commented code

* Add comment

* Remove useEffect from useApiToken

* Revert "Remove useEffect from useApiToken"

This reverts commit 9cf1e0c0bc.
2023-01-29 10:09:50 +01:00
Amanda Bullington
aa0060c21a Add JS and native exceptions (#371)
* Add native and JS exception handlers
* Ignore jsErrorHandler when error undefined; add stacktrace to log file
* Add instructions in comment for testing native exception

Closes #358

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-01-19 13:26:16 -08:00
Amanda Bullington
0d69fe1568 Fetch user locale from server and change language (#255)
* Fetch user from server, set locale in realm and change language with i18next
* Added some Spanish translations so I can see localization working
* config QueryClient with `cacheTime: Infinity` to deal with "Jest did not
  exit" errors

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-12-09 15:51:17 -08:00
Amanda Bullington
c4d9cd4dc6 Use babel-plugin-module-resolver (#188)
* Add alias and update eslint/flow to resolve modules

* Update aliases for components and api

* Add other src directories to module resolver aliases
2022-10-07 10:20:55 -07:00
Ken-ichi
e929764c25 Adopted and enforced code style from other iNat Javascript projects
These rules are largely based on the AirBnB ones, which are not quite standard
for the React Native world, where Prettier seems to be more common, but I
think they add a lot of useful checks, and unlike Prettier we can customize
them. This also just makes it easier for people on the iNat team to work on
the mobile app.

Some specific changes:

* Added eslint-plugin-react-hooks to eslint rules
* Added eslint-plugin-simple-import-sort to eslint rules
* Bugfix: could not import photo from gallery
* Added support for react-native/no-inline-styles eslint rule
* useUser should not bother fetching a user for a blank userId
2022-07-13 13:55:59 -07:00