Repository navigation
fix: resolve Picture/SingleSelect fields by type name, not numeric id - #1447
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Known, out of scope (follow-ups)
GetPlacesuses.Skip(1)without anOrderBy, 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