Skip to content

feat(frontend): integrate connected app flows - #134

Closed
gac0812 wants to merge 6 commits into
1024XEngineer:MVPfrom
gac0812:codex/frontend-app-integration
Closed

feat(frontend): integrate connected app flows#134
gac0812 wants to merge 6 commits into
1024XEngineer:MVPfrom
gac0812:codex/frontend-app-integration

Conversation

@gac0812

@gac0812 gac0812 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • compose session, schedule, assistant, overlay, dialog, and safe-area providers at the app root
  • connect manual and voice-created schedules to the same save, alarm, conflict, and error paths
  • report device location for active location reminders through the real WebSocket session
  • replace the legacy mock home screen and duplicated UI modules with the feature-based app shell

Why

The preceding PRs intentionally introduce isolated capabilities. This PR performs the application-level dependency injection so the production entry point uses the real transport, schedule service, assistant recorder, system alarms, and in-app dialogs together.

Dependency

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found five high-confidence runtime/security issues in the native integration paths. The TypeScript checks and test suite pass locally (npm run lint, npm run format:check, npm run typecheck, and 44 suites / 199 tests).

export class ExpoLocationProvider implements LocationProvider {
constructor(
private readonly module: ExpoLocationModule | null = requireOptionalNativeModule<ExpoLocationModule>(
'ExpoLocation',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Add expo-location or inject a provider in the production composition root. createLocationProvider() is used by AppShell without an injection, but expo-location is not a dependency in frontend/package.json or package-lock.json; on native builds requireOptionalNativeModule('ExpoLocation') therefore returns null and every location reminder tick fails with ExpoLocation 原生模块未链接.


/**
* 地点提醒位置上报器:客户端只上报位置,触发判定留给服务端。
* 当前 timer 是前台轮询;后台 task/围栏应由宿主注入更合适的 provider。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Provide a background-capable location task/geofence path before relying on location reminders. This implementation only polls with a JS setInterval; once the app is backgrounded or suspended, tick() stops running, so the server receives no position reports and cannot trigger location schedules. The app config requests background location, but no background task is registered here.

);

alarms.add(record);
saveAlarms(context, alarms);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Reschedule persisted alarms after device reboot. AlarmManager alarms are cleared by Android on reboot, and this branch only writes the records to SharedPreferences; there is no BOOT_COMPLETED permission/receiver or other startup rebuild that reads them. Every future alarm silently disappears after a reboot.

time_triggered_at: existing?.time_triggered_at ?? null,
geo_triggered_at: existing?.geo_triggered_at ?? null,
system_schedule_ref_id:
input.systemScheduleRefId !== undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Do not treat the locally-created Android alarm ID as durable schedule state. systemScheduleRefId is assigned only to the in-memory entity after the server upsert; the upsert payload never sends it, and a later bootstrap/push returns the backend's null ref. After relaunch or resync, editing/deleting the schedule passes previousAlarmId: null, leaving the old native alarm active and allowing duplicate/stale alarms.

}

const application = AndroidConfig.Manifest.getMainApplicationOrThrow(manifest);
application.$['android:usesCleartextTraffic'] = 'true';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Avoid enabling cleartext traffic for every release build. This app-wide manifest flag permits any HTTP/ws:// endpoint, so schedule and voice data can be sent without transport encryption if the configured URL is changed or redirected. Scope cleartext to a debug/dev network-security config, and require wss:// for production instead of weakening the whole application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant