Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Nov 3, 2025

Summary

  • expose venue inventory and assignment endpoints and include optional venue selectors on manual cancel routes
  • embed venue and wallet identifiers through order listings, log entries, and SSE payload builders
  • regenerate the OpenAPI client bindings and align storage helpers and tests with the new payload shape

Reviewing

Keep specs/multi_venue_emission.adoc in mind


https://chatgpt.com/codex/tasks/task_e_69089b1962808326ad5e7237ce14eac2

…tifier-and-refactor-queue' into codex/expand-openapi.yaml-for-venue-management

- Fix storage with duplicate UpsertVenue
@terwey terwey marked this pull request as ready for review November 3, 2025 21:12
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 900 to 918
if isPrimary {
if _, err := s.db.ExecContext(ctx, "UPDATE bot_venue_assignments SET is_primary = 0 WHERE bot_id = ?", botID); err != nil {
return api.VenueAssignmentRecord{}, err
}
}

primary := int64(0)
if isPrimary {
primary = 1
}

params := sqlcgen.UpsertBotVenueAssignmentParams{
BotID: botID,
VenueID: venueID,
IsPrimary: primary,
}

if err := s.queries.UpsertBotVenueAssignment(ctx, params); err != nil {
if isUniqueConstraintError(err) {

Choose a reason for hiding this comment

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

P1 Badge Make primary venue updates transactional

When UpsertVenueAssignment is called with isPrimary=true it unconditionally executes UPDATE bot_venue_assignments SET is_primary = 0 WHERE bot_id = ? before attempting the upsert. If the subsequent UpsertBotVenueAssignment call fails (for example because of a database error or a unique‑constraint violation) the function returns an error but the previous UPDATE is not rolled back, so the bot is left with no primary venue assignment even though the request failed. This introduces inconsistent state that requires manual recovery. Wrapping the demotion and upsert in a single transaction or deferring the demotion until the upsert succeeds would avoid this.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@codex please provide a fix for this, important pull the most recent branch because a commit happened after.

Choose a reason for hiding this comment

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

Summary

  • Wrapped primary venue demotion and upsert logic in a shared transaction to keep primary assignments consistent when failures occur. storage/api.goL900-L950

Testing

  • go test ./...

View task →

@terwey terwey merged commit aaf6d14 into codex/extend-orderwork-with-identifier-and-refactor-queue Nov 4, 2025
2 checks passed
@terwey terwey deleted the codex/expand-openapi.yaml-for-venue-management branch November 4, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants