Skip to content

fix: resolve Picture/SingleSelect fields by type name, not numeric id - #1447

Merged
renemadsen merged 1 commit into
stablefrom
fix/8141-shifted-lookup-ids
Oct 15, 2026
Merged

renemadsen merged 1 commit into
stablefrom
fix/8141-shifted-lookup-ids

Conversation

@renemadsen

Copy link
Copy Markdown
Member

SDK field-type ids are only contiguous by accident of AUTO_INCREMENT. On
a fresh install with auto_increment_increment=3 (Galera) Picture is 15
and SingleSelect is 24, so WorkflowCasesService.Read threw on
FirstAsync(FieldTypeId == 5) and GetPlaces returned no places for
FieldTypeId == 8. Both now filter on FieldType.Type.

The test project gains a ProjectReference to Workflow.Pn (it only held
a canary test before) and Testcontainers tests that seed field types on
a MariaDB with --auto-increment-increment=3.

Refs microting/eform-angular-frontend#8141

Test plan

  • Workflow.Pn.Test 4/4 (Testcontainers, --auto-increment-increment=3)

Known, out of scope (follow-ups)

  • GetPlaces uses .Skip(1) without an OrderBy, so which SingleSelect is skipped is not guaranteed.

No seeder change and no data migration in this PR: existing installs keep their ids, the code just stops assuming them.

🤖 Generated with Claude Code

SDK field-type ids are only contiguous by accident of AUTO_INCREMENT. On
a fresh install with auto_increment_increment=3 (Galera) Picture is 15
and SingleSelect is 24, so WorkflowCasesService.Read threw on
FirstAsync(FieldTypeId == 5) and GetPlaces returned no places for
FieldTypeId == 8. Both now filter on FieldType.Type.

The test project gains a ProjectReference to Workflow.Pn (it only held
a canary test before) and Testcontainers tests that seed field types on
a MariaDB with --auto-increment-increment=3.

Refs microting/eform-angular-frontend#8141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

🟢 Approval recommended

The focused fix has regression coverage and no identified blocking issues; tests were not run in this review.

0 open findings

What changed in this PR

Fixes workflow field lookups on Galera installations where generated field-type IDs differ from assumed values.

Changes:

  • Resolves Picture and SingleSelect fields by type name instead of numeric ID.
  • Adds MariaDB regression tests with shifted IDs and a reference to the workflow project.
File Description
eFormAPI/​Plugins/​Workflow.Pn/​Workflow.Pn/​Services/​WorkflowCasesService/​WorkflowCasesService.cs Replaces numeric field-type filters with type-name filters.
eFormAPI/​Plugins/​Workflow.Pn/​Workflow.Pn.Test/​Workflow.Pn.Test.csproj References the workflow project for service tests.
eFormAPI/​Plugins/​Workflow.Pn/​Workflow.Pn.Test/​ShiftedLookupIdsTests.cs Tests shifted IDs and both affected service methods.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renemadsen
renemadsen merged commit 96bcc23 into stable Oct 15, 2026
9 checks passed
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