Improving Event Consistency and Proxy Persistence in Maxun

Fixed event payload inconsistency and implemented proxy persistence across robot creation flows in the Maxun automation platform.

Description

## Overview

This contribution improves the reliability of the Maxun browser automation platform by fixing event payload inconsistencies and ensuring proxy configurations are properly persisted when robots are created or duplicated.

## Problem

Two key issues were identified in the codebase:

1. Inconsistent urlChanged Event Payload

Some parts of the system emitted the urlChanged event as a plain string while others emitted an object. This caused inconsistencies in frontend components such as BrowserNavBar and RunsTable.

2. Proxy Configuration Not Persisted

After the introduction of the proxy field in the Robot database schema, multiple robot creation flows did not include the proxy value. As a result, proxy settings were lost when robots were created or duplicated.

## Solution

The following fixes were implemented:

- Standardized the urlChanged event payload across the system to:

{ url: string, userId: string }

- Updated notifyUrlChange in the Generator class to emit the correct event format.

- Ensured the Generator class correctly receives and stores the userId so events emit accurate metadata.

- Updated all robot persistence flows to propagate the proxy field:

- Generator.ts

- storage.ts

- record.ts

- sdk.ts

- Ensured Robot.create and Robot.update payloads correctly pass proxy configuration so database records reflect the actual runtime proxy.

## Impact

These improvements ensure:

- Consistent event communication between backend and frontend components.

- Reliable proxy configuration persistence across robot lifecycle operations.

- Better maintainability and predictability in automation workflows.

## Technologies Used

- TypeScript

- Node.js

- Socket.IO

- Playwright

- PostgreSQL

Issues & PRs Board
No issues or pull requests added.