Skip to content

Comments

Fixed batch trigger scheduling during app type import#3

Open
philayres wants to merge 1 commit intodevelopfrom
fix-batch-trigger-import-issue-225
Open

Fixed batch trigger scheduling during app type import#3
philayres wants to merge 1 commit intodevelopfrom
fix-batch-trigger-import-issue-225

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

- 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

1 participant