- Security gems versions updates
- Update
WebflowSync::InitialSyncJobto use newshould_skip_webflow_sync?andwebflow_collection_idmethods #56 (thank you @aedificator-nl)
WebflowSync::Apirewrite.webflow_syncgem (this gem) now useswebflow-rbgem instead ofwebflow-rubygem. This change was made to be able to use the latest version ofwebflow-rbgem which is actively maintained. It also supports Webflow API v2 and you no longer need to specify bothwebflow_syncandwebflow-rubygems in your Gemfile.
Before:
gem 'webflow-ruby', github: 'vfonic/webflow-ruby', branch: 'api-v2'
gem 'webflow_sync'After:
gem 'webflow_sync'- Refactor
WebflowSyncjob classes:WebflowSync::CreateItemJob,WebflowSync::UpdateItemJob,WebflowSync::DeleteItemJobto usecollection_idas a keyword argument as opposed tocollection_slugas positional argument. When upgrading the gem, if you're not directly calling these jobs, you don't need to do anything. The gem will still usecollection_slugto get thecollection_id.
- Always check
WebflowSync.configuration.skip_webflow_syncandrecord.skip_webflow_syncbefore syncing a record. - When switching from create/update to update/create because of
webflow_item_idalready present/blank, enqueue the job instead of performing it inline.return WebflowSync::CreateItemJob.perform_later(model_name, id, collection_slug) if record.webflow_item_id.blank?instead ofreturn WebflowSync::CreateItemJob.perform_now(model_name, id, collection_slug) if record.webflow_item_id.blank?. This helps to have the correct job visible on the queue in the jobs dashboard.
- Fix: Remove class methods that do depend on
site_idargument:get_all_items,get_item,create_item,update_item,delete_item
- Fix: Allow calling
WebflowSync::Api.newwithout passing insite_idargument. - Add class methods to
WebflowSync::Apiclass for all methods that don't requiresite_idargument:get_all_items,get_item,create_item,update_item,delete_item,sites - This allows us to call
WebflowSync::Api.new.sitesor even shorterWebflowSync::Api.sites.
- Make sure all Webflow API calls catch "Rate limit hit" error and retry
- Add
WebflowSync::Api.sitesmethod to allow fetching all Webflow sites with retrying on rate limiting
- As long as the error is
Rate limit hit, sleep 10 seconds and retry the request - Lower the Rails version requirement to >= 5.0
- Remove
WebFlow.configuration.publish_on_syncconfig option. This is no longer needed. We rely on Webflow correctly updating collection items by sendinglive='true'parameter on every create/update/delete request. - Call
WebflowSync::UpdateItemJobinWebflowSync::CreateItemJobif record already containswebflow_item_id. This can sometimes happen when we create a record in Rails, then update the record, so now there areWebflowSync::CreateItemJobandWebflowSync::UpdateItemJobjobs for the record, and then for some reason, firstWebflowSync::CreateItemJobjob fails. (This can happen for example becauseRate limit hitor some other Webflow API error.)WebflowSync::UpdateItemJobwill then run beforeWebflowSync::CreateItemJoband it will callWebflowSync::CreateItemJob. After that, when the originalWebflowSync::CreateItemJobruns, it will create another record and overwrite thewebflow_item_idcreated byWebflowSync::UpdateItemJob. - This gem currently only works with a fork of 'webflow-ruby':
gem 'webflow-ruby', github: 'vfonic/webflow-ruby', branch: 'allow-live-delete'
- Require Rails >= 7.0
- Revert "Explicitly require Webflow::Client and Webflow::Error" (v4.0.2 is the same as v4.0.0)
- Explicitly require Webflow::Client and Webflow::Error
- Bump dependencies
- Require Ruby 3.1 (Ruby 3.x is only required because of the new syntax used in the gem code)
- Allow syncing Rails model with any WebFlow collection. It doesn't have to have collection
slugthat matches the Rails model name.
- Added
WebFlow.configuration.publish_on_sync(trueby default) config option. Iftrue, after each sync, the gem will publish the site on all domains.