Ghost/ghost/custom-theme-settings-service/test
Daniel Lockyer 8859d6298c
Added guard for activateTheme being called in parallel causing sync bugs (#15053)
refs https://github.com/TryGhost/Team/issues/1666

- it seems like we may have a situation where `.activateTheme()` can be called simultaneously resulting in unexpected behaviour in the sync such as duplicate theme setting records
- adjusted behaviour to keep track of the currently running activation within the service and if `.activateTheme()` is called again whilst it's in progress it will wait for completion of the first sync before exiting early or continuing with a new activation

**Note:** There is a known edge-case if there are _more_ than 2 parallel `.activateTheme()` calls. We don't believe that will be an issue but calling it out in case we do still see duplicated custom setting records being created.

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-08-04 11:29:58 +01:00
..
utils
.eslintrc.js
cache.test.js Reworked imports for custom-theme-settings-service tests 2022-07-20 17:47:23 +02:00
service.test.js Added guard for activateTheme being called in parallel causing sync bugs (#15053) 2022-08-04 11:29:58 +01:00