#22114·meshery

[Server] Rewriting a saved test configuration silently retains the old payload

Author: maverickaayushCreated Sep 27, 2026Updated Sep 28, 2026

Description

TestProfilesPersister.WriteTestConfig silently retains stale JSON when called with an existing configuration ID, even though it has an explicit existing-row update branch.

Current Behavior

Writing {"name":"old"} and then {"name":"new"} under the same ID returns success, but GetTestConfig still returns old.

Expected Behavior

The existing-row branch should replace PerformanceTestConfigBytes with the newly supplied payload.

Steps to Reproduce

  1. Migrate PerformanceTestConfig in an in-memory database.
  2. Call WriteTestConfig(id, oldPayload).
  3. Call WriteTestConfig(id, newPayload) with the same ID.
  4. Read the configuration and observe the old name.

Evidence

$ go test ./server/models -run '^TestReproTestProfileWriteOverwritesExistingConfig$' -count=1
second write was ignored: got name "old", want new
FAIL

Root Cause

WriteTestConfig loads the stored record into p and immediately writes that unchanged record back. It assigns result to PerformanceTestConfigBytes only in the create branch.

Affected Components

  • Meshery Server
  • Performance test configuration persistence
  • Local provider performance profiles

Validation

Executed on master commit 5b75615243e92b088b4ebf6e7bff82d6f60e5462:

go test ./server/models -run '^TestReproTestProfileWriteOverwritesExistingConfig$' -count=1

Result: deterministic failure; the second payload is not persisted.

Acceptance Criteria

  • The existing-row path stores the incoming configuration bytes.
  • Reading after a second write returns the second payload.
  • A regression test covers two writes under the same key.

References