[FEAT]: InApp Messaging and Event Handler

Open
#130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
nuxt, typescript

Research direction

First inspect the repo's nuxt.config.ts and any existing composables/ or layers/ directories to see how a layer would be wired via extends, plus the current Firebase/Firestore client setup. Then scaffold a remote-event-layer exposing useRemoteEventDocument and useRemoteEventCollection as auto-imported, generic-typed composables, keeping onSnapshot calls behind client-only guards so SSR renders pending immediately and unsubscribing in onUnmounted. Done looks like all five verification steps in the issue passing, including no SSR hang and listeners closed on route navigation.

Written by the indexing model from the issue text.

Description

impact: low-blast

📋 Product Context & User Story

User Story
  • As a frontend developer building on the Connect platform
  • I want to integrate the remote-event-layer into my Nuxt 4 host application
  • So that I can securely bind client-side UI components to real-time Firestore updates without causing SSR execution to hang or memory to leak.
Visuals & UX
  • Figma Canvas Link: N/A (Headless architectural layer)
  • Othe Component State: N/A

🛡️ Requirements Traceability & QA

[REQ-REL-0??]

Acceptance Criteria

[ ] [REQ-REL-0??] AC 1: The layer can be successfully imported into a Nuxt 4 host application via the extends property in nuxt.config.ts.

[ ] [REQ-REL-0??] AC 2: The useRemoteEventDocument and useRemoteEventCollection composables are auto-imported and support TypeScript generics for strict data typing.

[ ] [REQ-REL-0??] AC 3: Serving the app via SSR instantly renders the fallback pending state; the server process does not hang waiting for a database connection.

[ ] [REQ-REL-0??] AC 4: Client-side route navigation successfully triggers the Vue cleanup hooks, explicitly terminating the active Firestore onSnapshot listeners to prevent memory leaks.

Verification Test Script
Step Action Expected Result Pass/Fail
1 Add remote-event-layer to host app nuxt.config.ts extends array. Nuxt initializes successfully with the layer context.  
2 Mount <script setup lang="ts"> const { data, pending } = useRemoteEventDocument('col', 'id') </script> in a test page. IDE recognizes the auto-imported composable and correctly types the returned data.  
3 Execute npm run build and serve the application via Node. Page loads instantly from the server showing pending: true. SSR node process completes without hanging.  
4 Hydrate the page in the browser and monitor the network tab. Connection to Firestore is established and the reactive data object populates with live database records.  
5 Navigate to a different Nuxt route via the client-side router. The active Firestore listener is explicitly unsubscribed in the background.  

⚡ Blast Radius Assessment

impact: high-blast
Note: While execution is restricted to client-side Vue lifecycle hooks, this architecture introduces direct browser-to-database connections (Firestore). Sub-tasks should be spun up to ensure Firebase Security Rules are strictly configured for the target collections to prevent unauthorized client reads via this new layer.

Dominant language
No language data
Stars
0
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bcgov/connect

All issues in bcgov/connect

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.