Skip to content

Mzolfagh/laverna#95

Merged
LuckyIntegral merged 19 commits intodevfrom
mzolfagh/laverna
Mar 12, 2026
Merged

Mzolfagh/laverna#95
LuckyIntegral merged 19 commits intodevfrom
mzolfagh/laverna

Conversation

@zolfagharipour
Copy link
Copy Markdown
Owner

@zolfagharipour zolfagharipour commented Mar 11, 2026

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

  • Socket notifications now include triggeredByUuid – The server emits triggeredByUuid (instead of internal IDs) in notification:new payloads. Laverna relies on this to like back, reply to messages, and block users.
  • Laverna bot added – New 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

  1. Configure – Copy laverna/.env.example to laverna/.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)
  2. Start server – Run the API and Socket.IO server.

  3. Run Laverna – From repo root: pnpm run dev:laverna (or pnpm run prod:laverna after building).

  4. 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)

  5. 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 matchId params 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.

Comment thread server/src/routes/socials/blocks.ts Outdated
Comment thread client/src/app/app/profile/[id]/page.tsx Outdated
Comment thread server/src/routes/discovery/browsing.ts
Comment thread laverna/src/index.ts Outdated
Comment thread laverna/src/gemini.ts Outdated
Comment thread server/src/routes/socials/blocks.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread laverna/src/index.ts Outdated
Comment thread laverna/src/index.ts Outdated
Comment thread laverna/src/gemini.ts
@LuckyIntegral LuckyIntegral merged commit 3f58bec into dev Mar 12, 2026
2 checks passed
@LuckyIntegral LuckyIntegral deleted the mzolfagh/laverna branch March 12, 2026 20:27
LuckyIntegral added a commit that referenced this pull request Apr 2, 2026
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.

3 participants