- Rename mobile app directory to client throughout the project - Restructure client app code into feature-based organization - Move code to src/features/workspaces/domain/presentation - Move services to src/integrations/ (mattermost, workspace, proto_socket) - Add app bootstrap and main entry point - Add push notification integration (Mattermost push client/host/plugin) - Add proto socket integration for real-time communication - Add integration tests for push and socket components - Archive old milestone: client-integration-standardization.md - Add new workflow core milestone: roadmap-driven-agent-ops-automation.md - Update agent-ops rules (project, core, mobile, contracts, workspace-ops) - Update roadmap files (ROADMAP.md, current.md, phase PHASE.md files) - Update bin scripts (build, dev, lint, test) - Add test environments documentation - Update contracts notes for Flutter Core API
5.2 KiB
Client Integration Handoff & Migration Notes
Important
Host App Integration Standard As of the
mattermost-push-plugin-extractionmilestone, all native FCM services, Room DB structures, JJWT signature verification, inline reply/dismiss receivers, notification builders, and ACK request handling have been successfully extracted into the local Flutter plugin repository:../mattermost-push-plugin.Do NOT edit native push files directly inside this host app repository (
apps/client/android). All native push logic and platform services now reside in and must be maintained within the plugin repository.
1. Responsibility Split & Boundaries
To keep host architectures generic and lightweight, we maintain a strict boundary between host logic and external dependency plugins.
1.1 Mattermost Push Notification Boundary
- Host Application (
apps/client) Responsibilities:- Firebase Manifest & Metadata:
google-services.jsoninsideapps/client/android/app/- Initializing Firebase inside
lib/src/app/bootstrap.dartviaFirebase.initializeApp().
- Credential Plumbing:
- Host standardizes all credential synchronization through the
MattermostPushClientinterface rather than accessing the native plugin directly:- Login: Sync authorization credentials via
pushClient.setAuthToken(serverUrl, token). - Logout: Revoke and clear credentials via
pushClient.setAuthToken(serverUrl, ''). - Asymmetric Signing Keys: Register server public keys via
pushClient.setSigningKey(serverUrl, publicKey).
- Login: Sync authorization credentials via
- Host standardizes all credential synchronization through the
- App Navigation Callbacks:
- Wire navigation delegates on the
MattermostPushClientinterface:onNavigateToChannel = (serverUrl, channelId) => ...: Handles custom routing logic to channel view on notification click.onNavigateToThread = (serverUrl, rootId) => ...: Handles CRT thread view navigation.
- Wire navigation delegates on the
- Device Token Sync:
- Listen to token registration callbacks via the
onDeviceTokenReadycallback onMattermostPushClientinterface, and forward the target device token back to the Mattermost backend server. - Note: Production calls to
MattermostPushPlugin.instanceare strictly isolated and encapsulated within theMattermostPushPluginClientadapter implementation, maintaining a generic, testable host bootstrap.
- Listen to token registration callbacks via the
- Firebase Manifest & Metadata:
- Mattermost Push Plugin (
mattermost_push_plugin) Responsibilities:- Intercepting incoming FCM pushes via Kotlin services (
MattermostFirebaseMessagingService). - Parsing payloads and verifying cryptographic signatures with JJWT.
- Interacting with local SQLite database (Room DB).
- Building native system notifications, dismissing ACKs, and inline replies.
- Intercepting incoming FCM pushes via Kotlin services (
1.2 Proto-socket Integration Boundary
- Host Application (
apps/client) Responsibilities:- Local Dependency Setup:
- Reference the local path package
proto_socketinpubspec.yaml.
- Reference the local path package
- Facade Configuration:
- Read configuration defaults through
ProtoSocketEndpointConfig.fromEnv(). - Wire connections via
ProtoSocketLifecyclefacade inside the bootstrap stream.
- Read configuration defaults through
- No-Op Auto-connect:
- By default, bootstrap configures the lifecycle with
enabled: falseand usesNoopProtoSocketConnector(). - Real socket initialization and active transport loops are decoupled from bootstrap and deferred to client UI activation.
- By default, bootstrap configures the lifecycle with
- Local Dependency Setup:
2. Platform Target Status & Expansion
2.1 Web Target
- Supported in core configuration bootstrap.
- Socket facade safely falls back to standard WebSocket interfaces or no-op handlers in non-supported native environments.
2.2 Android Target
- Fully operational for Mattermost push notifications.
- Integrates Firebase Cloud Messaging, JJWT verification, Room Database, and native background broadcasts.
2.3 iOS Target Status & Native Extension
- iOS is fully integrated into the unified Dart API boundary.
- Dart Level Integration: Sibling systems can target iOS using identical calls (
MattermostPushClientmethods). - Native Implementation Extension: Sibling repos can implement native APNS delegate receivers inside the iOS project folder without needing to modify common Dart facades or common bootstrap parameters.
3. Reference Sibling Repo Alignment & Replacement
When replicating this integration boundary in sibling repositories (../iop and ../alt):
Checklist for Sibling Alignment:
- Firebase Credential Sync: Provide valid
google-services.json(Android) andGoogleService-Info.plist(iOS) in respective project roots. - Local Path Imports: Ensure
pubspec.yamlpoints correctly to the actual sibling workspace dependency paths:
Note: If sibling repositories utilize different directory hierarchies (e.g. nested packages or monorepo namespaces), the relative path must be adjusted accordingly to point to the correct workspace location of the shared libraries.mattermost_push_plugin: path: ../../../mattermost-push-plugin proto_socket: path: ../../../proto-socket/dart - Endpoint Realization: Initialize client configuration with workspace endpoints matching your target backend (e.g. IOP portal routing or ALT quant metrics server).