Skip to content

Work in Progress: Poll improvements#329

Open
Miercko wants to merge 8259 commits into
micromata:developfrom
Miercko:feature/2026-poll-improvements
Open

Work in Progress: Poll improvements#329
Miercko wants to merge 8259 commits into
micromata:developfrom
Miercko:feature/2026-poll-improvements

Conversation

@Miercko
Copy link
Copy Markdown
Contributor

@Miercko Miercko commented Feb 6, 2026

No description provided.

* commit '68b65b8e88e8ed6e54bd9b2f9e9e8bcbbae0efb7':
  Bump rexml from 3.3.9 to 3.4.2 in /site
kreinhard and others added 24 commits December 31, 2025 08:28
Breadcrumb links were reusing stale deserialized page instances after
validation errors, causing wrong tasks to open in TaskTree.

Root cause: After validation error (e.g., cyclic task reference attempt),
clicking breadcrumb 'Strukturbaum' loaded a deserialized TaskTreePage
from Wicket's page store with stale task IDs baked into the HTML.
Clicking on tasks then opened wrong tasks.

Solution: Breadcrumb onClick() now always creates fresh page instances
using ReflectionHelper.newInstance() instead of setResponsePage(page).
Falls back to page.getClass() when returnToPageClass is null.

This ensures pages always load current data from cache (e.g., TaskTree),
not stale data from serialized pages.

Verified: Page versioning can remain enabled - no global changes needed.
1. TaskDao: Move cyclic reference check into synchronized block
   - Prevents race condition where two threads could both pass the check
     and create a cycle in the task tree
   - Check now happens in onInsertOrModify() under lock before other
     constraint checks

2. TaskTree: Add defensive cyclic reference check in addOrUpdateTaskNode()
   - Safety net in case corrupted data makes it through validation
   - Detects cycles using node.isParentOf(newParent) before updating
   - Marks cache as expired and throws IllegalStateException if detected
   - Forces complete reload on next access to recover from corruption
Introduces EmployeeScriptingService as a scripting proxy following the
established ScriptingDao pattern. This allows Kotlin/Groovy scripts to
access read-only EmployeeService methods without direct bean access.

Changes:
- New: EmployeeScriptingService wraps EmployeeService with read-only methods
- ScriptExecutor: Register employeeService variable for all scripts
- ScriptExecutor: Add EmployeeStatus to STANDARD_IMPORTS

Key methods exposed to scripts:
- getWeeklyWorkingHours() with historical date support
- getAnnualLeaveDays() with historical date support
- isEmployeeActive(), getEmployeeStatus()
- selectAllActive(), findByUserId(), findByStaffnumber()

Scripts can now use: employeeService.getWeeklyWorkingHours(employee, date)
Fixed three critical issues in ForecastExport:

1. NullPointerException when periodOfPerformanceType=OWN but dates are null
   - Replaced dangerous !! operators with safe PFDay.fromOrNull()
   - Added fallback to order-level dates using Elvis operator
   - Added warning log for data quality tracking

2. Empty month columns when using snapshot date
   - analyzeOrderPositions now checks ctx.snapshot flag
   - Snapshot data from auftragDO.info is used instead of cache
   - Fixes "time travel" functionality for historical orderbook snapshots

3. Inverted cache logic in addOrderPosition
   - Corrected logic: useAuftragsCache=true now uses cache
   - When false, uses provided order data (from snapshot)

These fixes restore the forecast export functionality with snapshots.
- Changed PollMultiResponseQuestion to use UICheckbox instead of UIRadioButton
  to allow multiple selections (PollResponsePageRest.kt)
- Fixed calculateAnswerDistribution to use .toString() == "true" for
  proper boolean comparison (ExcelExport.kt)
- Added 4 Excel sheets: Summary, Detailed Responses, Question Statistics,
  Missing Responses with improved formatting and statistics
…ss Users and attendees who haven't responded
@Miercko
Copy link
Copy Markdown
Contributor Author

Miercko commented Feb 6, 2026

Der Ganze Mail Kram muss dann nochmal ordentlich getestet werden.

@Miercko
Copy link
Copy Markdown
Contributor Author

Miercko commented Feb 9, 2026

DB Migration bezüglich neuer Felder planen / besprechen.

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.

3 participants