Braze deduplication middleware not available when using obfuscated bundle fetches
cysp opened this issue · 0 comments
Analytics.js 2.0 fails to fetch the Braze deduplication middleware (analytics.js-middleware-braze-deduplicate) when obfuscation is enabled.
This appears to be caused by a bug in the asset uploading script in this repository which assumes that there are no interior . characters in the base part of integration filenames:
analytics.js-integrations/scripts/upload-assets.js
Lines 113 to 115 in f8cc444
Analytics.js 2.0 expects to find the integration script at https://cdn.segment.com/next-integrations/middleware/YW5hbHl0aWNzLmpzLW1pZGRsZXdhcmUtYnJhemUtZGVkdXBsaWNhdGU/latest/YW5hbHl0aWNzLmpzLW1pZGRsZXdhcmUtYnJhemUtZGVkdXBsaWNhdGU.js.gz (the obfuscated equivalent of https://cdn.segment.com/next-integrations/middleware/analytics.js-middleware-braze-deduplicate/latest/analytics.js-middleware-braze-deduplicate.js.gz), which currently gives a 404 response.
The obfuscation logic in the uploading script in this repository has resulted in the file incorrectly being uploaded as https://cdn.segment.com/next-integrations/middleware/YW5hbHl0aWNz/latest/YW5hbHl0aWNz.js-middleware-braze-deduplicate.js.gz