Skip to content

Conversation

@philayres
Copy link
Collaborator

Resolves consected#225

Summary

Fixed issue where dynamic models with batch_trigger.frequency: once were being unexpectedly scheduled during app type imports. These one-time batch jobs should only be created when explicitly saved by an admin, not recreated on every configuration re-import.

Changes

  • Added check in Dynamic::DefHandler#handle_batch_schedule to skip scheduling 'once' frequency jobs when Admin::AppTypeImport.import_in_progress? is true
  • Fixed incomplete run_at: parameter in recurring job scheduling (was missing value)
  • Added comprehensive test suite to verify the fix

Tests

  • ✅ Verifies no jobs created during import with frequency: 'once'
  • ✅ Verifies import_in_progress flag is properly managed
  • ✅ Verifies jobs ARE created when saving after import completes (normal behavior preserved)
  • ✅ All tests passing with proper delayed job configuration and active model setup

…ected#225

- Prevent scheduling of 'once' frequency batch triggers during app type import
- Added import_in_progress? check to handle_batch_schedule method
- Only affects 'once' frequency triggers - other frequencies work normally
- Fixed incomplete run_at parameter in else branch
- Added comprehensive test coverage for import scenario
- Test verifies no jobs created during import for 'once' frequency
- Test verifies import_in_progress? flag management

This resolves the issue where batch trigger dynamic models set to 'once'
were being triggered unexpectedly when included in an app_type import.
…ected#225

- Added check to prevent 'once' frequency batch triggers from being scheduled during app type import
- Fixed incomplete run_at parameter in handle_batch_schedule for recurring jobs
- Added comprehensive test suite with proper delayed job configuration
- Tests verify no jobs created during import and jobs are created normally after import
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.

batch trigger dynamic models set to "once" are triggered unexpectedly when included in an app_type import

2 participants