Conversation
There was a problem hiding this comment.
Pull request overview
Adds the “Laverna” simulated account bot (new laverna/ workspace package) and adjusts server/client behavior to better support automated end-to-end testing via Socket.IO notifications and UUID-based identifiers.
Changes:
- Added
laverna/package to automate registration, profile setup, discovery likes, Socket.IO handling, and Gemini-based chat replies. - Updated real-time messages API schema to accept UUID
matchIdparams and adjusted client cache invalidation on new notification payload fields. - Modified socials/discovery server behavior (notifications, block side-effects, and discovery filtering).
Reviewed changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/schemas/realTimesSchema.ts | Switches matchId request param validation to UUID schema. |
| server/src/socket/chatHandlers.ts | Stops escaping outgoing chat message content before DB insert. |
| server/src/routes/socials/likes_matches.ts | Changes unlike notification to be awaited; adds action: 'unlike' metadata. |
| server/src/routes/socials/blocks.ts | Adds transactional block flow with like/match cleanup, stats updates, and block notification. |
| server/src/routes/discovery/browsing.ts | Changes gender/sexual-preference filtering semantics in discovery query. |
| client/src/contexts/SocketContext.tsx | Adds react-query invalidations on notification events (matches, notifications, user profiles). |
| client/src/app/app/profile/[id]/page.tsx | Invalidates matches on block/unblock; adds UI status labels. |
| client/src/app/app/chat/page.tsx | Removes polling, increases caching, and clears selection when match disappears. |
| laverna/* | New bot implementation (API client, socket handling, Gemini integration, logging, config/docs). |
| package.json / pnpm-workspace.yaml / pnpm-lock.yaml / eslint.config.mts | Registers laverna workspace and tooling config updates. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
server/src/routes/socials/likes_matches.ts:168
- The unlike notification is persisted/emitted before the potential match deletion and stats updates. Since the client invalidates/refetches
['matches']when it receives{ type: 'other', action: 'unlike' }, this ordering can cause the client to refetch matches before the match is deleted and then cache the stale result. Emit the notification after match deletion/stats updates (or include enough info in the notification to drive consistent client updates).
await createAndPushNotification(likedUserId, userId, 'other', 'Someone unliked you', { action: 'unlike' });
const rows = await query<MatchRow>('SELECT id FROM matches WHERE (user1_id = ? AND user2_id = ?)', [
minUserId,
maxUserId,
]);
const { enqueueFameRatingRecalc } = await import('../../utils/fameRating.js');
if (rows.length > 0) {
await pool.query('DELETE FROM matches WHERE (user1_id = ? AND user2_id = ?)', [minUserId, maxUserId]);
await pool.query(
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 24 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Laverna – Simulated Account Bot for Testing
Laverna – Roman goddess, patron of gain (lawful and unlawful), rogues and thieves.
Inclementia – Latin for harshness, severity, cruelty, lack of mercy.
What is Laverna?
Laverna is a simulated dating app user that automates registration, profile setup, discovery browsing, likes, and real-time chat. It uses Gemini AI to generate contextual replies and opening messages. Use it to test the full user flow without manual interaction.
Changes
triggeredByUuid– The server emitstriggeredByUuid(instead of internal IDs) innotification:newpayloads. Laverna relies on this to like back, reply to messages, and block users.laverna/package that registers, logs in, updates profile, uploads a photo, connects via Socket.IO, browses discovery, likes users, and responds to matches/messages with AI-generated text.How to Use for Testing
Configure – Copy
laverna/.env.exampletolaverna/.env:API_BASE_URL– API base (default:http://localhost:5000/api)SOCKET_URL– Socket.IO server (default:http://localhost:5001)GEMINI_API_KEY– From [Google AI Studio] (I send you in discord)Start server – Run the API and Socket.IO server.
Run Laverna – From repo root:
pnpm run dev:laverna(orpnpm run prod:lavernaafter building).Verify email – On first run, Laverna registers and prints a verification link in the server terminal. Open it, then press Enter in the Laverna terminal.
(on dev only press Enter)
Observe – Laverna browses discovery and likes users (~1.8s between likes, respects rate limits). On likes received, it likes back. On matches, it sends an AI-generated opening. On messages, it replies via Gemini; after 5 exchanges it sends a rejection, then unlikes and blocks. Check server logs and Laverna output for behaviour.