Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# UNRELEASED

# V0.9.4

- Feat: Add `stale_scope` option to CRM DSL to restrict which records the `StaleRecords::Finder` considers. Accepts a lambda returning an ActiveRecord scope, applied at SQL level before any record is processed. This prevents unnecessary `CrmSynchronisation` rows for records that `sync_if` would skip. Models that do not specify `stale_scope` are not affected — the Finder behaves exactly as before.
- Feat: Add `error_count` column to `crm_synchronisations` to track consecutive sync failures. Records exceeding the configurable `max_sync_errors` limit (default: 3) are automatically excluded from `StaleRecords::Finder`. The limit can be set globally via `config.max_sync_errors` or per CRM via `options: { max_sync_errors: N }`. Use `CrmSynchronisation#reset_error_count!` to manually re-enable sync after fixing the root cause. Run `rails g etlify:add_error_count` to generate the migration.
- Feat: Add `sync_dependencies` option for dependency-based sync ordering. When a dependency has no `crm_id` yet, the sync is buffered in `etlify_pending_syncs` and automatically retried once the dependency is synced. Supports both etlified models (via `CrmSynchronisation`) and legacy models with a direct `#{crm_name}_id` column (e.g. `airtable_id`). Requires running `rails g etlify:migration create_etlify_pending_syncs && rails db:migrate`.
Expand Down
2 changes: 1 addition & 1 deletion lib/etlify/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Etlify
VERSION = "0.9.3"
VERSION = "0.9.4"
end