Skip to content

fix: version-control init race condition + missing pydantic Field import - #2

Open
MikyJ05 wants to merge 2 commits into
Ekaanth:mainfrom
MikyJ05:fix/version-init-race-and-field-import
Open

fix: version-control init race condition + missing pydantic Field import#2
MikyJ05 wants to merge 2 commits into
Ekaanth:mainfrom
MikyJ05:fix/version-init-race-and-field-import

Conversation

@MikyJ05

@MikyJ05 MikyJ05 commented Jul 9, 2026

Copy link
Copy Markdown

Two small bug fixes:

1. fix(web): prevent duplicate main branch on concurrent version-control init

Multiple components call VersionManager.initialize() on mount. When two calls raced, both could try to create the main branch, causing a failure on the unique by-name index. This change shares a single in-flight init promise per project and, as a safety net, recovers gracefully if a concurrent init already created main (reuses the existing branch instead of throwing).

2. fix(ai-backend): add missing Field import in engagement.py

app/routes/engagement.py uses Field(...) in several request/response models (e.g. image_urls: list[str] = Field(..., min_length=1, max_length=10)) but only imported BaseModel from pydantic, so importing the module raises NameError: name 'Field' is not defined and the engagement routes fail to load.

Both verified locally on Windows: web app boots clean (Next.js 16.1.3) and the AI backend starts with all routes registered and /health responding.

🤖 Generated with Claude Code

MikyJ05 and others added 2 commits July 9, 2026 22:14
… init

Multiple components initialize version control on mount; share a single
in-flight init promise per project and recover gracefully if a concurrent
init already created the main branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Ekaanth
Ekaanth self-requested a review July 15, 2026 08:54

@Ekaanth Ekaanth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

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.

2 participants