Skip to content

fix(timeplanning): seed missing settings keys so UpdateSettings doesn't NRE#1611

Merged
renemadsen merged 1 commit into
stablefrom
fix/seed-pauseid-selfheal-setting
Jun 17, 2026
Merged

fix(timeplanning): seed missing settings keys so UpdateSettings doesn't NRE#1611
renemadsen merged 1 commit into
stablefrom
fix/seed-pauseid-selfheal-setting

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Problem

PR #1609 added the PauseIdSelfHealEnabled property to the plugin's bound TimePlanningBaseSettings but did not add a corresponding seed row. The eform settings framework looks up each bound property by its PluginConfigurationValue row when UpdateSettings runs; a missing row causes a NullReferenceException on save.

The pre-existing DaysBackInTimeAllowedEditingEnabled property (a string, written by TimeSettingService.UpdateSettings) had the same unseeded gap and fails the same way.

Fix

Seed both keys in TimePlanningConfigurationSeedData:

  • TimePlanningBaseSettings:PauseIdSelfHealEnabled = true (bool? property, bool-parsed)
  • TimePlanningBaseSettings:DaysBackInTimeAllowedEditingEnabled = 0 (string property, read as == "1" in TimeSettingService line ~91, so "0" is the disabled default)

The startup seed is idempotent, so redeploy backfills the rows for existing tenants — no EF migration needed.

Tests in ConfigurationSeedDataTests assert both seed rows are present.

Notes

🤖 Generated with Claude Code

…dEditingEnabled so settings save doesn't NRE

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a runtime failure in the TimePlanning plugin settings flow by ensuring required PluginConfigurationValue rows exist for bound TimePlanningBaseSettings properties, preventing UpdateSettings from throwing when saving settings.

Changes:

  • Adds seed rows for TimePlanningBaseSettings:PauseIdSelfHealEnabled and TimePlanningBaseSettings:DaysBackInTimeAllowedEditingEnabled.
  • Adds NUnit tests asserting the presence of the new seed rows.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Data/Seed/Data/TimePlanningConfigurationSeedData.cs Adds missing configuration seed entries for newly/previously unseeded settings keys.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/ConfigurationSeedDataTests.cs Introduces tests to ensure the required seed rows exist.

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

Comment on lines +230 to 234
new PluginConfigurationValue
{
Name = $"{TimePlanningBaseSettingsName}:DaysBackInTimeAllowedEditingEnabled",
Value = "0"
}
Comment on lines +22 to +32
[Test]
public void SeedData_Contains_DaysBackInTimeAllowedEditingEnabled()
{
var seedData = new TimePlanningConfigurationSeedData();

Assert.That(
seedData.Data.Any(x =>
x.Name == "TimePlanningBaseSettings:DaysBackInTimeAllowedEditingEnabled"
&& x.Value == "0"),
Is.True);
}
@renemadsen renemadsen merged commit 1593aa6 into stable Jun 17, 2026
39 checks passed
@renemadsen renemadsen deleted the fix/seed-pauseid-selfheal-setting branch June 17, 2026 14:08
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