Skip to content
master
Switch branches/tags
Code

Latest commit

)

This changeset adds support for mirroring the removal of a page in Contentful in Bedrock's sqlite database.

The main behavioural changes are:

* The "archive", "unpublish" and "delete" events now trigger an API poll, whereas before they did not
* The "create" event of a page no longer counts as a 'go signal' for an API poll (and probably shouldn't have been in the first instance)
* We continue to ask the API for all the pages it knows of (for the relevant environment + API key combination), so we get a list of page IDs which we attempt to sync. After that attempt, we then query sqlite and look for any ContentfulEntry records we hold that were NOT in the list of IDs we just tried to sync -- and we delete those entries. This approach means that even if a sync for a particular page fails, we won't delete the page from sqlite -- this is safer than tracking 'sucessful ids' and deleteing all pages that are not in that successful set.

The sync still has slightly different behaviour on Dev than in Prod, in that Dev will act upon more states than Prod, because Dev can and will show draft pages as a way of previewing them.
6de24f7

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

Bedrock

Bedrock is the code name of mozilla.org. It is as shiny, awesome, and open source as always. Perhaps even a little more.

Circle CI

Docs

Bedrock is a Django project. Check out the django docs for general technical documentation. In addition, there are project-specific bedrock docs.

Contributing

Patches are welcome! Feel free to fork and contribute to this project on GitHub. If you find a problem and wish to report it, please file a bug.

Looking for a good first bug to work on? Take a look at our contributing doc to get started.

Code of Conduct

This repository is governed by Mozilla's Community Participation Guidelines and Developer Etiquette Guidelines.

License

This software is licensed under the MPL version 2.0. For more information, read this repository's LICENSE.

credit @designerham