Syncing audiences and custom dimensions in parallel can result in the cached audiences not being persisted #8888
Labels
Module: Analytics
Google Analytics module related issues
P2
Low priority
Team M
Issues for Squad 2
Type: Bug
Something isn't working
Bug Description
When making parallel requests to sync both audiences and custom dimensions (
POST:sync-audiences
andPOST:sync-custom-dimensions
), it can result in the cached audiences not being persisted. It seems the call tosync-audiences
saves the audiences, but the parallel call tosync-custom-dimensions
then deletes them.Steps to reproduce
Here is a straightforward way to exhibit the bug. Please note this was discovered during development of #8160 and so these instructions will only work once that issue's PR is merged (or by checking out the branch for the PR, see #8885).
audienceSegmentation
feature flag enabled, and connect an Analytics property which has some data.availableAudiences
andavailableCustomDimensions
settings.POST:sync-audiences
andPOST:sync-custom-dimensions
endpoints. If the property has got the new/returning visitor audiences set up with data, you may also see a couple of failed requests to thesave-resource-data-availability-date
endpoint (see screenshot below). Once this bug is fixed these requests should not fail. Note that the bug doesn't occur every time - if you see these calls tosave-resource-data-availability-date
succeed, try again from point 3.availableAudiences
isNULL
or empty, rather than being an array of audiences as expected. Again, the bug doesn't occur every time so if you do see an array of audiences, try again from point 3.Screenshots
Actual:
![image](https://private-user-images.githubusercontent.com/18395600/340406721-aab0addd-23ff-4bde-804b-55e8fd97dc5b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjUzMTYsIm5iZiI6MTcyMzA2NTAxNiwicGF0aCI6Ii8xODM5NTYwMC8zNDA0MDY3MjEtYWFiMGFkZGQtMjNmZi00YmRlLTgwNGItNTVlOGZkOTdkYzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA3VDIxMTAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4YTQzOGMyYmQxYjUyNmZhMDI0MzZjYWEyZDNjYzhhOTUyZWYxM2Q2ZTc0OTUyMGIxNDhlNGY3N2RhNzczODUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7PV7su-QF-eUC5MflGJphbSAzJjLGoe9k0MJFW2HXsE)
Expected:
![image](https://private-user-images.githubusercontent.com/18395600/340407068-92fa0eb1-7b07-401b-8bf5-e123ccd99e44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjUzMTYsIm5iZiI6MTcyMzA2NTAxNiwicGF0aCI6Ii8xODM5NTYwMC8zNDA0MDcwNjgtOTJmYTBlYjEtN2IwNy00MDFiLThiZjUtZTEyM2NjZDk5ZTQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA3VDIxMTAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhZGRkMWU5YzdjNmM2ODViZGNkMTYxMDc4NGRhMWZjYTNlOGM0MGU1YTYxNTYxN2I5MzUwM2FmYjhiMGQ2MTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9WGXNy4VN_Wt_eawLps_MAEzWkA8g35F-LtdHEFotiU)
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
POST:sync-audiences
andPOST:sync-custom-dimensions
should not interfere with each other.sync-custom-dimensions
.sync-audiences
with different timing.Implementation Brief
Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: