Skip to content

Fixes #36018: gate Profiler Settings Save when the stored config fetch fails - #36034

Merged
ShaileshParmar11 merged 2 commits into
mainfrom
detail/bug-fix/fixes-36018-gate-profiler-settings-save-when-the-s-6ae217
Oct 23, 2026
Merged

ShaileshParmar11 merged 2 commits into
mainfrom
detail/bug-fix/fixes-36018-gate-profiler-settings-save-when-the-s-6ae217

Conversation

@detail-app

@detail-app detail-app Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #36018

I worked on ProfilerSettingsModal because, when the initial getTableProfilerConfig GET failed (transient network error, 5xx, timeout), the modal only showed an error toast, left the form filled with DEFAULT_VALUES, and left Save enabled. Saving then PUT a defaults-only TableProfilerConfig, and the backend stores that config as a whole-row replacement (REPLACE INTO / ON CONFLICT DO UPDATE SET json = EXCLUDED.json) — so profileQuery, includeColumns, excludeColumns, partitioning and any non-default sample settings were silently and permanently wiped. The bug has been present since the modal was introduced (455c2d0).

Type of change:

  • Bug fix

High-level design:

N/A — small change.

The fix tracks the fetch failure in a new isFetchFailed state (set in the load effect's catch branch, cleared on success) plus a retryCount state in the effect's dependency array. While isFetchFailed:

  • The defaults-filled form is replaced in the drawer body by a SomethingWentWrongPlaceholder (with a Retry button that re-runs the load by bumping retryCount) — so the user is not invited to "save" defaults.
  • The Save button is disabled via isDisabled={isFetchFailed} (defence-in-depth; the hidden form can't submit either).
  • The existing error toast is kept for parity with the rest of the app.

Gating is on the fetch failure, not on storedConfig === undefined, so the legitimate first-time-config case (fetch succeeds with no stored config) still renders the form and enables Save. The error placeholder + retry mirrors the sibling TestSummary component's load-error pattern in the same Profiler area.

Tests:

Use cases covered

  • Opening Profiler Settings when the stored-config GET fails shows an error placeholder with Retry, hides the defaults-filled form, and disables Save — no PUT is sent.
  • A successful Retry reloads the real stored config into the form and re-enables Save; saving then round-trips the stored config (profileQuery / excludeColumns / partitioning preserved, not defaults).
  • Repeated failures keep Save disabled and the form hidden.
  • Cancel/close after a failed fetch sends no PUT.
  • Happy path unchanged: a successful load (with or without a stored config) renders the form, enables Save, and round-trips existing config shapes (all partitioning types, PERCENTAGE/ROWS samples including 0, edited fields, disabled partitioning, cleared sample, unsupported interval types).

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: ProfilerSettingsModal.test.tsx (4 new tests in a when the stored config fetch fails describe block: blocks-save-and-offers-retry, no-PUT-on-attempted-save, retry-reloads-and-re-enables-save, save-enabled-on-success).
  • Suite passes 28/28 (24 existing + 4 new). No regressions across the Database/Profiler (25 suites / 403 tests) and TableProfiler (11 suites / 151 tests) suites.

Backend integration tests

  • Not applicable (no backend API changes). The backend whole-row-replacement behavior is unchanged; the fix is client-side and ensures a lossy DEFAULT_VALUES payload is never sent from a failed-fetch state.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable — no new Playwright E2E added. The Jest component tests render the patched component and assert the exact DOM behavior (error placeholder present, form hidden, Save toBeDisabled(), Retry reloads real config, no putTableProfileConfig call on failed fetch).

Manual testing performed

  • Verified the backend data-loss mechanism via curl against a running 1.8.0 Docker stack: PUT a real config (profileQuery/excludeColumns/includeColumns/60% sample), then PUT a defaults-only config (100% sample, sampleDataCount 50, no other fields). The subsequent GET confirmed profileQuery, excludeColumns, and includeColumns were all wiped to null and the sample overwritten — proving whole-row replacement with no merge, which is why the client-side gate is the necessary guard.
  • Playwright E2E against the running stack was attempted but blocked by a version mismatch: the dev-branch Playwright apiSignIn posts to /api/v1/auth/login (a 2.0.0 endpoint), while the only published Docker server image (1.8.0) does not expose it (returns 500/404) and a 1.12.0-SNAPSHOT image is not published. The component-level Jest tests cover the same browser-visible behavior.

UI screen recording:

Not applicable — standalone bug fix. No new UI surface; the change replaces a form with an existing error-placeholder component under an already-failed load.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: N/A (no schema changes).
  • For a UI feature or feature task: N/A — standalone fix (see UI screen recording above).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (pr-checklist skill) and fixed every 🔴 finding.
  • Decision check: no durable decision needing a docs/decisions/ record.
  • I have added a test that covers the exact scenario we are fixing.

Automatic Fixes PRs can be configured here.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no actionable issues found.

Summary

Prevents a failed Profiler Settings load from exposing a defaults-filled form that could overwrite saved settings.

  • Profiler Settings blocks saving when its config fetch fails.

No new actionable issues were found. No previous review threads were supplied.

Reviews (2) · Last reviewed commit: "refactor(ui): drop the shadowed form par..." · Reviewed by Greptile

@detail-app
detail-app Bot requested a review from a team as a code owner October 23, 2026 03:12
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@detail-app detail-app Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
79.2% (128653/162427) 65.69% (45274/68917) 68.65% (25776/37543)

@sonarqubecloud

Copy link
Copy Markdown

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified the bug on main and the fix: a failed config load now hides the defaults-filled form, disables Save, and offers Retry, so no defaults-only PUT can overwrite the stored profiler config. UI checks green.

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 08b31f5 Oct 23, 2026
83 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the detail/bug-fix/fixes-36018-gate-profiler-settings-save-when-the-s-6ae217 branch October 23, 2026 08:52
ShaileshParmar11 added a commit that referenced this pull request Oct 23, 2026
…h fails (#36034) (#36091)

Backport to 2.0. A failed config load left the drawer filled with defaults
and Save enabled; the PUT replaces the stored config whole, so one save wiped
the table's profile query, column lists, partitioning and sample settings.
Show the error with a Try Again action instead of the form and disable Save
until the config loads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Profiler Settings: Saving after failed config load overwrites stored table profiler config with defaults

1 participant