Skip to content

fix(mockup): BUG-400b — remove non-existent columns from saveMockupToDb INSERT#571

Merged
adm01-debug merged 1 commit into
mainfrom
fix/mockup-save-remove-nonexistent-columns
Jun 1, 2026
Merged

fix(mockup): BUG-400b — remove non-existent columns from saveMockupToDb INSERT#571
adm01-debug merged 1 commit into
mainfrom
fix/mockup-save-remove-nonexistent-columns

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented Jun 1, 2026

Bug

saveMockupToDb tentava inserir 4 colunas que não existem em generated_mockups:

// ANTES — colunas inexistentes, rejeitadas silenciosamente pelo PostgREST:
position_x: area.positionX,
position_y: area.positionY,
logo_width_cm: area.logoWidth,
logo_height_cm: area.logoHeight,

O insert não falhava visivelmente porque o código tem try/catch que silencia erros — mas o Supabase rejeitava essas colunas em cada salvamento de mockup.

Por que não há perda de dados

Esses valores já estavam sendo salvos corretamente dentro de area_config JSONB (que foi adicionado nessa mesma função):

area_config: {
  positionX: area.positionX,   // ← já salvo aqui
  positionY: area.positionY,   // ← já salvo aqui
  logoWidth: area.logoWidth,   // ← já salvo aqui
  logoHeight: area.logoHeight, // ← já salvo aqui
  ...
}

E o fetchMockupHistory (corrigido no PR #570) já extrai esses valores de area_config para expor como position_x, position_y, etc.

Fix

Remover as 4 linhas duplicadas do INSERT. 1 arquivo, 4 linhas removidas.


Summary by cubic

Removed non-existent columns position_x, position_y, logo_width_cm, and logo_height_cm from saveMockupToDb INSERT to resolve Linear BUG-400b. This stops silent PostgREST rejections on save; the values are already saved in area_config JSONB, so no data loss.

Written for commit 748ab8e. Summary will update on new commits.

Review in cubic

…Db INSERT

position_x, position_y, logo_width_cm, logo_height_cm do not exist as
columns in generated_mockups. They were silently rejected by PostgREST
on every mockup save. The values are already preserved inside area_config
JSONB (positionX, positionY, logoWidth, logoHeight), so no data is lost.

Also updated header comment to document all BUG-400 fixes applied.
Copilot AI review requested due to automatic review settings June 1, 2026 12:11
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
we-dream-big Error Error Jun 1, 2026 12:12pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@adm01-debug, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 22 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78cf61b0-7c37-47f4-ae42-a3ad18dd2027

📥 Commits

Reviewing files that changed from the base of the PR and between 65b4a8a and 748ab8e.

📒 Files selected for processing (1)
  • src/hooks/mockup/mockupGenerationService.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mockup-save-remove-nonexistent-columns

Comment @coderabbitai help to get the list of available commands and usage tips.

@supabase
Copy link
Copy Markdown

supabase Bot commented Jun 1, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@adm01-debug adm01-debug merged commit 6266a95 into main Jun 1, 2026
26 of 34 checks passed
@adm01-debug adm01-debug deleted the fix/mockup-save-remove-nonexistent-columns branch June 1, 2026 12:29
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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