- Security gems versions updates
- Update
WebflowSync::InitialSyncJob
to use newshould_skip_webflow_sync?
andwebflow_collection_id
methods #56 (thank you @aedificator-nl)
WebflowSync::Api
rewrite.webflow_sync
gem (this gem) now useswebflow-rb
gem instead ofwebflow-ruby
gem. This change was made to be able to use the latest version ofwebflow-rb
gem which is actively maintained. It also supports Webflow API v2 and you no longer need to specify bothwebflow_sync
andwebflow-ruby
gems in your Gemfile.
Before:
gem 'webflow-ruby', github: 'vfonic/webflow-ruby', branch: 'api-v2'
gem 'webflow_sync'
After:
gem 'webflow_sync'
- Refactor
WebflowSync
job classes:WebflowSync::CreateItemJob
,WebflowSync::UpdateItemJob
,WebflowSync::DeleteItemJob
to usecollection_id
as a keyword argument as opposed tocollection_slug
as 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_slug
to get thecollection_id
.
- Always check
WebflowSync.configuration.skip_webflow_sync
andrecord.skip_webflow_sync
before syncing a record. - When switching from create/update to update/create because of
webflow_item_id
already 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_id
argument:get_all_items
,get_item
,create_item
,update_item
,delete_item
- Fix: Allow calling
WebflowSync::Api.new
without passing insite_id
argument. - Add class methods to
WebflowSync::Api
class for all methods that don't requiresite_id
argument:get_all_items
,get_item
,create_item
,update_item
,delete_item
,sites
- This allows us to call
WebflowSync::Api.new.sites
or even shorterWebflowSync::Api.sites
.
- Make sure all Webflow API calls catch "Rate limit hit" error and retry
- Add
WebflowSync::Api.sites
method 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_sync
config 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::UpdateItemJob
inWebflowSync::CreateItemJob
if record already containswebflow_item_id
. This can sometimes happen when we create a record in Rails, then update the record, so now there areWebflowSync::CreateItemJob
andWebflowSync::UpdateItemJob
jobs for the record, and then for some reason, firstWebflowSync::CreateItemJob
job fails. (This can happen for example becauseRate limit hit
or some other Webflow API error.)WebflowSync::UpdateItemJob
will then run beforeWebflowSync::CreateItemJob
and it will callWebflowSync::CreateItemJob
. After that, when the originalWebflowSync::CreateItemJob
runs, it will create another record and overwrite thewebflow_item_id
created 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
slug
that matches the Rails model name.
- Added
WebFlow.configuration.publish_on_sync
(true
by default) config option. Iftrue
, after each sync, the gem will publish the site on all domains.