Skip to content

fix: snippet content missing after move or rename - #47409

Merged
charislam merged 1 commit into
masterfrom
charis/fix-move-rename-snippets
Jun 29, 2026
Merged

charislam merged 1 commit into
masterfrom
charis/fix-move-rename-snippets

Conversation

@charislam

@charislam charislam commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Snippet content was wiped blank after a move or rename (until dashboard refreshed) because it depended on the API returning the new content, but the API returns under the content field, not the unchecked_sql field that is expected. Added a remapSqlContentField remap to fix.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the saved content response so snippet fields are mapped consistently before being returned.
    • Kept the saved status unchanged while updating the returned data shape for better accuracy.

Snippet content was wiped blank after a move or rename (until dashboard
refreshed) because it depended on the API returning the new content, but
the API returns under the `content` field, not the `unchecked_sql` field
that is expected. Added a `remapSqlContentField` remap to fix.
@charislam
charislam requested a review from a team as a code owner June 29, 2026 16:24
@vercel

vercel Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jun 29, 2026 4:28pm
studio-staging Ready Ready Preview, Comment Jun 29, 2026 4:28pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jun 29, 2026 4:28pm
design-system Skipped Skipped Jun 29, 2026 4:28pm
docs Skipped Skipped Open in v0 Jun 29, 2026 4:28pm
ui-library Skipped Skipped Jun 29, 2026 4:28pm
zone-www-dot-com Skipped Skipped Open in v0 Jun 29, 2026 4:28pm

Request Review

@supabase

supabase Bot commented Jun 29, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5616b3d2-5b26-408c-bde0-33e5e4b64c7b

📥 Commits

Reviewing files that changed from the base of the PR and between 9b3d57f and 02b304c.

📒 Files selected for processing (1)
  • apps/studio/data/content/content-upsert-mutation.ts

📝 Walkthrough

Walkthrough

upsertContent now wraps the returned snippet with remapSqlContentField(snippet) before spreading it, applying consistent SQL field remapping to the upsert response. A corresponding import for remapSqlContentField is added.

Changes

Upsert response field remapping

Layer / File(s) Summary
Apply remapSqlContentField in upsertContent
apps/studio/data/content/content-upsert-mutation.ts
Imports remapSqlContentField and applies it to the snippet before returning, replacing the direct spread of the raw snippet object.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A snippet returned, but fields were askew,
The rabbit remapped them, good as new! 🐇
With one little import and a function call small,
The SQL fields line up, consistent for all.
Hop hop, the data flows true!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is on-topic but missing the required template sections like behavior, context, and issue links. Expand the PR description to fill the template sections: confirmation, change type, current behavior, new behavior, and additional context.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the bug fix and names the primary user-facing issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch charis/fix-move-rename-snippets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@charislam
charislam enabled auto-merge (squash) June 29, 2026 19:07
@charislam
charislam merged commit b34a9a0 into master Jun 29, 2026
36 of 37 checks passed
@charislam
charislam deleted the charis/fix-move-rename-snippets branch June 29, 2026 19:14
@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  223 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  230 tests across 25 suites
duration  4 minutes, 22 seconds
commit  02b304c

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › broadcast modal validates JSON payload
Features › sql-editor.spec.ts › SQL Editor › should check if SQL editor is working as expected

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@github-actions

github-actions Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1782760620)

Score Average Improvements Regressions
Completeness 100% (+1pp) 1 🟢 -
Conciseness 38.5% (-1pp) 7 🟢 8 🔴
Correctness 67.8% (+0pp) 2 🟢 3 🔴
Docs Faithfulness 62.5% (-2pp) 3 🟢 4 🔴
Goal Completion 82.2% (+2pp) 4 🟢 3 🔴
Knowledge Usage 92.3% (-5pp) - 2 🔴
Tool Usage 74.5% (+0pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 92.9% (+7.000000000000001pp) 1 🟢 -
Time_to_first_token 2.26tok (-0.51tok) 22 🟢 7 🔴
Llm_calls 6.85 (-0.15) 7 🟢 13 🔴
Tool_calls 2.89 (+0.08) 12 🟢 10 🔴
Errors 0 (-0.01) 1 🟢 -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23227.84tok (-1798.55tok) 14 🟢 11 🔴
Prompt_cached_tokens 7638.8tok (+753.29tok) 17 🟢 11 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 589.59tok (+16.56tok) 10 🟢 19 🔴
Completion_reasoning_tokens 93.18tok (+4.68tok) 9 🟢 17 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 23817.43tok (-1781.99tok) 15 🟢 14 🔴
Estimated_cost 0$ (0$) 18 🟢 8 🔴
Duration 11.98s (-3.67s) 25 🟢 4 🔴
Llm_duration 9.46s (-0.78s) 19 🟢 10 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Related to Supabase Dashboard self-hosted Related to self-hosted Supabase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants