P3.4-A: Enhanced public API JSDoc - Enhanced createSchedule() with detailed parameter docs and examples - Enhanced updateSchedule() with examples and error documentation - Enhanced deleteSchedule() with error documentation - Enhanced enableSchedule() with examples P3.4-B: Created troubleshooting guide - docs/TROUBLESHOOTING.md with common issues and solutions - Covers CI failures, packaging, platform tests, build, permissions, recovery, performance - Linked in docs/00-INDEX.md Verification: - TypeScript compiles ✅ - JSDoc generates in .d.ts files ✅ - Documentation created and linked ✅
3.7 KiB
3.7 KiB
Troubleshooting Guide
Purpose: Common issues, symptoms, causes, and solutions.
Owner: Development Team
Last Updated: 2025-12-22
Status: active
CI Failures
Symptom: ./ci/run.sh fails
Causes:
- Forbidden files in package
- Core module imports platform deps
- Export paths don't match artifacts
Solutions:
- Check forbidden files:
npm pack --dry-run | grep -E "xcuserdata|xcuserstate|DerivedData|ios/App/" - Check core purity:
grep -r "@capacitor\|react\|fs\|path\|os" src/core/ - Check exports:
node -e "const p=require('./package.json'); console.log(JSON.stringify(p.exports, null, 2))"
Packaging Failures
Symptom: npm pack includes forbidden files
Causes:
package.jsonfilesfield is too permissive.npmignoreis missing or incomplete
Solutions:
- Review
package.jsonfilesfield (should be whitelist) - Add to
.npmignore:**/xcuserdata/,**/*.xcuserstate,**/DerivedData/,ios/App/,.DS_Store - Run
npm pack --dry-runto verify
Platform Test Failures
Symptom: Android tests fail in CI
Causes:
- Robolectric SDK version mismatch
- Missing test dependencies
- Test database setup issues
Solutions:
- Check
@Config(sdk = [34])matches Robolectric version - Verify
android/build.gradlehas test dependencies - Check
TestDBFactorycreates in-memory database correctly
Symptom: iOS tests not running in CI
Causes:
- macOS runner not available
- xcodebuild not found
- Test app not configured
Solutions:
- Use scheduled/manual workflows for iOS tests
- Verify
xcodebuildis available:xcodebuild -version - Check test app configuration in
test-apps/ios-test-app/
Build Failures
Symptom: TypeScript compilation fails
Causes:
- Type errors in source code
- Missing type definitions
- Incorrect import paths
Solutions:
- Run
npx tsc --noEmitto see all type errors - Check import paths match
package.jsonexports - Verify all dependencies are installed:
npm install
Symptom: Build succeeds but runtime errors occur
Causes:
- Missing runtime dependencies
- Incorrect module resolution
- Platform-specific code not available
Solutions:
- Check
dist/directory contains expected files - Verify
package.jsonexports match build artifacts - Test on actual platform (not just build)
Permission Issues
Symptom: Notifications not appearing
Causes:
- Permission not granted
- Battery optimization killing background tasks
- Platform-specific permission issues
Solutions:
- Check permission status:
await DailyNotification.checkPermission() - Request permission:
await DailyNotification.requestPermission() - Check battery optimization settings (Android)
- Verify Info.plist/AndroidManifest.xml permissions
Recovery Issues
Symptom: Missed notifications after app restart
Causes:
- Recovery not running on app launch
- Database corruption
- Platform-specific recovery limitations
Solutions:
- Check recovery logs in history:
await DailyNotification.getHistory({ kind: 'recovery' }) - Verify recovery is called on app launch
- Check database integrity
- Review platform-specific recovery constraints
Performance Issues
Symptom: Slow database queries
Causes:
- Large number of schedules
- Missing database indexes
- Database corruption
Solutions:
- Check query performance in logs (warnings if > 100ms)
- Review database schema for missing indexes
- Consider database cleanup/migration
See also:
- SYSTEM_INVARIANTS.md — Enforced system invariants
- PERFORMANCE.md — Performance characteristics
- docs/progress/03-TEST-RUNS.md — Test run history