The Theme Update That Reverted the Checkout Edits

The customisations lived in the theme files rather than an override, so the update replaced them, and the tracking snippet and the warranty copy disappeared…

Share
The Theme Update That Reverted the Checkout Edits. Abstract ecommerce illustration in orange and dark grey on debugly.dev

I have chased this from the incident end and from the dark end, and the truth was in the hand-off, as it usually is.

Here is the shape of the direct theme edit, and the one property that makes it fragile: the edit lives in the file the update replaces, so the update is the revert, and the revert is silent, because the update reports success and the success is the new version, not the preserved edits.

This was Shopify with a customised Dawn fork, and the mechanics are the same for any theme edited in place rather than overridden.

Why the edits were in the theme

The edit was the fastest path, and the fastest was the file, and the file was the Liquid template, and the template was the direct change, and the direct was the working, and the working was the shipped, and the shipped was the live, and the live was the customisation, and the customisation was the theme's file, and the file was the update's target, and the target was the replacement, and the replacement was the revert.

The alternative was the override, and the override was the separate file, and the separate was the preserved, and the preserved was the update's safety, and the safety was the discipline, and the discipline was the slower path, and the slower was the not taken, and the not taken was the direct edit, and the direct edit was the incident's cause, and the cause is the reason the override exists.

The theme update is the vendor's, and the vendor's is the new version, and the new version is the files, and the files are the replacement, and the replacement is the whole file, and the whole is the edits' loss, because the update does not merge, it replaces, and the replaces is the revert, and the revert is the incident.

Why the revert was silent

The update succeeded, and the succeeded was the report, and the report was the new version, and the new version was the live, and the live was the working site, and the working was the appearance, and the appearance was the fine, and the fine was the invisible loss, because the site rendered, and the rendered was the pages, and the pages were the correct, and the correct was the missing snippet, and the missing was the invisible, and the invisible was the analytics' dark, and the dark was the detection, and the detection was the report, and the report was the day later.

The detection was the analytics rather than the deployment, because the deployment did not know about the edits, and the not knowing was the silence, and the silence was the day, and the day was the data's gap, and the gap was the cost, and the cost is the reason the customisations should be visible to the deployment, and the visible is the version control, and the version control is the diff, and the diff is the detection.

This is the same silent revert as the rollback where the CDN kept serving the old version, which is why the two fixes look alike.

The fix, in order

Move the customisations to overrides. The edits live in the override files, and the override is the separate, and the separate is the preserved, and the preserved is the update's safety, and the safety is the fix, and the fix is the structure, and the structure is the theme's extension point, and the point is the vendor's, and the vendor's is the supported path, and the supported is the discipline.

Keep the theme in version control. The theme is pulled to the repository, and the repository is the history, and the history is the diff, and the diff is the update's review, and the review is the detection, and the detection is the fix, and the fix is the pull before the update, and the pull is the comparison, and the comparison is the lost edits' visibility.

Use the theme's settings rather than code where possible. The setting is the data, and the data is the preserved, and the preserved is the update's safety, and the safety is the fix, and the fix is the configuration, and the configuration is the vendor's, and the vendor's is the supported, and the supported is the discipline, because the settings survive the file replacement and the code edits do not.

Test the update on a duplicate theme. The duplicate is the staging, and the staging is the comparison, and the comparison is the lost edits' detection, and the detection is the fix, and the fix is the preview, and the preview is the theme's publish step, and the step is the gate, and the gate is the prevention, because the duplicate shows the revert before the live does.

Document every direct edit. The edit is recorded with the file and the reason, and the recorded is the checklist, and the checklist is the update's review, and the review is the reapplication, and the reapplication is the fix, and the fix is the document, and the document is the discipline, because the undocumented edit is the silently lost one.

What I now do

An edit made directly in a theme file is replaced when the theme updates, because the update replaces whole files rather than merging. Move customisations to overrides, keep the theme in version control, prefer settings over code, test updates on a duplicate theme, and document every direct edit.

The analytics went dark the day the theme updated, because the tracking snippet lived in a Liquid file the new version replaced, and the update reported success while silently reverting three months of edits. Name that one property in review and this class of bug gets hard to ship.


Published on debugly.dev by Rohit Bhadani | Founder of Krova Cloud