Commit 548ea08
feat: updates to support new cloudsync version (#3)
* fix: parse JSON response from cloudsync_network_sync
* chore: add test-suite plan
* chore: add @testing-library/react-native for hook tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add shared mocks for native modules
Mock files for op-sqlite, NetInfo, expo-notifications,
expo-secure-store, expo-task-manager, expo-constants,
and expo-application.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add pure function and createDatabase tests (46 tests)
- testUtils.tsx with createTestWrapper for hook tests
- calculateAdaptiveSyncInterval (10 tests)
- isSqliteCloudNotification (12 tests)
- logger (8 tests)
- pushNotificationSyncCallbacks (5 tests)
- constants (2 tests)
- createDatabase (9 tests)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add core logic tests (67 tests)
- initializeSyncExtension (11 tests)
- executeSync (14 tests)
- backgroundSyncConfig (10 tests)
- backgroundSyncRegistry (7 tests)
- executeBackgroundSync (13 tests)
- registerPushToken (12 tests)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add pushNotificationSyncTask, optionalDependencies, and context hook tests (28 tests)
- pushNotificationSyncTask (8 tests)
- optionalDependencies (10 tests)
- useSqliteDb (2 tests)
- useSyncStatus (2 tests)
- useSqliteSync (2 tests)
- useInternalLogger (2 tests)
- useTriggerSqliteSync (2 tests)
- Fix react-test-renderer version to match react 19.1.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add hook tests for useSqliteExecute, useSqliteTransaction, useOnTableUpdate, useInitialSync
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add complex hook tests for sync manager, lifecycle, polling, push notifications, and reactive queries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add useDatabaseInitialization and SQLiteSyncProvider integration tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add coverage for permission fallback, auth, and config in SQLiteSyncProvider
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: update gitignore
* fix: skip push token registration when siteId is unavailable
When cloudsync_init fails or returns no siteId, skip registerPushToken
entirely instead of registering with undefined siteId. The registration
will retry on next app open since hasRequestedPermissionsRef resets on mount.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add Tier 1 coverage gap tests (262 total, 82.96% branches)
Add 10 targeted tests covering uncovered branches:
- useDatabaseInitialization: empty name, empty tables, close errors
- useSqliteExecute/Transaction: non-Error thrown value wrapping
- useSqliteSyncQuery: debounce timer clearing on query change
- usePushNotificationSync: registerPushToken failure handling
- isSqliteCloudNotification: Android dataString wrong URI
- useSyncManager: push-mode error skips interval recalculation
* test: add Tier 2 coverage gap tests (272 total, 85.47% branches)
Add 10 targeted tests covering additional uncovered branches:
- logger: default parameter (debug=false) branch
- useNetworkListener: null isInternetReachable/isConnected coercion
- useAdaptivePollingSync: interval-to-null stops scheduling
- useOnTableUpdate: empty rows returns null row
- useSyncManager: Android with null isInternetReachable
- initializeSyncExtension: empty rows, site_id logging branches
- useSqliteSyncQuery: stale subscription signature skip
* test: suppress console.warn leak in backgroundSyncRegistry test
* chore: update .claude/plans/test-suite-design.md
* fix: correct push token registration auth header and base URL
- Change auth header from Bearer connectionString?apikey=key to Bearer apiKey
- Update base URL to cloudsync-staging-testing.fly.dev
- Remove unused connectionString param from registerPushToken
* fix: resolve TypeScript errors across test files
Add jest and node types to tsconfig.json, fix missing required fields
(syncMode, siteId, createTableSql) in test mocks, correct adaptive
config field names, and prefix unused variables with underscore.
* fix: imports
* fix: update network_init params
* fix: initializeSyncExtension
* fix: push fallback behavior
* fix: register push token endpoint call
* fix: isSqliteCloudNotification
* fix: update cloudsync commands / endpoints usage
* fix: .env.example
* fix: .env files
* fix: env variables
* fix: custom network init
* chore: bump version to 0.9.201
* chore: update documentation
* chore: update documentation
* chore: update documentation
* chore: update documentation
* chore: update documentation
* tests: improve coverage
* fix: use sqlite-sync main repo instead of dev one
* chore: update cloudsync url to be the production one
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Gioele Cantoni <gioele.cantoni@gmail.com>
Co-authored-by: Gioele Cantoni <48024736+Gioee@users.noreply.github.com>1 parent 1fcffd5 commit 548ea08
File tree
78 files changed
+7395
-648
lines changed- .claude/plans
- android
- examples
- sync-demo-bare
- src
- types
- sync-demo-expo
- src
- types
- src
- __mocks__
- @op-engineering
- @react-native-community
- core
- __tests__
- background
- __tests__
- common/__tests__
- database
- __tests__
- lifecycle/__tests__
- polling/__tests__
- pushNotifications
- __tests__
- sync
- __tests__
- hooks
- context/__tests__
- sqlite/__tests__
- sync
- __tests__
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
78 files changed
+7395
-648
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
0 commit comments