Skip to content

Fix duplicate experiment row after first experiment creation#3174

Merged
zackcl merged 1 commit into
devfrom
feature/3172-fix-duplicate-experiment-list-row
Jun 11, 2026
Merged

Fix duplicate experiment row after first experiment creation#3174
zackcl merged 1 commit into
devfrom
feature/3172-fix-duplicate-experiment-list-row

Conversation

@zackcl

@zackcl zackcl commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Resolves #3172

After creating the first experiment and navigating back to the Experiments page, the same experiment could appear twice until refresh.

This happened because the store treated totalExperiments = 0 as if the total count was unknown. When the detail page loaded the newly created experiment, the reducer changed totalExperiments from 0 to 1, which allowed the root page pagination logic to fetch and append the first page again.

This change preserves 0 as a valid loaded total count and only falls back to 1 when the total count is actually unknown (null or undefined). That keeps direct detail loading behavior intact while preventing the extra pagination fetch that caused the duplicate row.

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adjusts how totalExperiments is derived during single-experiment load/upsert actions to better distinguish “unknown total” from “confirmed empty list”, and updates the inline reducer comment accordingly.

Changes:

  • Updates reducer logic to use nullish-coalescing for totalExperiments instead of a truthy check.
  • Clarifies the intent in comments, including preserving 0 as a meaningful value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zackcl zackcl merged commit 6f4742e into dev Jun 11, 2026
5 of 6 checks passed
@zackcl zackcl deleted the feature/3172-fix-duplicate-experiment-list-row branch June 11, 2026 17:47
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.

Experiment duplicated in list after returning from detail page

3 participants