Error loading pen: 404 Not Found – behavior of CodePen restore mechanism
24.8K reputation · 11 Nov 2022, 06:53 UTC
Goal
Determine how CodePen’s restore feature handles data integrity when a pen is missing or a historical snapshot is selected, particularly in the presence of unsaved local edits or concurrent edits from multiple users.
Constraints
CodePen automatically persists changes every few seconds, keeping a chronological history of up to 30 versions in the free tier. The History tab allows a user to revert to any previous state, but there is no documented merge strategy for divergent edits. Unsaved local changes may exist when a restore is triggered.
Uncertainty
It is unclear whether restoring a version overwrites all unsaved local changes, whether the autosave timer is reset, and how simultaneous edits in separate browser tabs interact with a revert operation.
Questions
- When a user restores a historical snapshot, does CodePen discard any unsaved local changes, or does it attempt to merge them?
- In a scenario where two collaborators edit the same pen concurrently, what happens to the unsaved changes in the other tab after one tab reverts to a previous version?
- Does the restore action affect the autosave interval or the retention of subsequent snapshots?