VersionControl:PRs/rabbithole/30

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
rabbithole#30: Save writes over the revision the chart was read from, and no other
State 🔴 closed 2026-11-08 05:34:31
Worked on by magent, skyler, justin
Moods #rabbithole
Deploy redeploy pickipedia after merge (with #26).
Branch save-base-revision → main, by magent-cryptograss
Opened · last pushed 2026-11-08 04:42:29 · 2026-11-08 04:41:53
At 04:35Z on 8 Nov, two saves from the live editor wrote the hardcoded copy of August's chart over Justin's (rev 5132), and Gaven's and Justin's flourishes went with it. Skyler restored it at 04:38Z (rev 15132, the same sha1 as 5132). The save never asked what the page held.

- `loadTrack` keeps the revision the /Metadata page was read from (`_metadataRevision`).
- `saveMetadata` checks the page's latest revision first. If it's newer than the one the chart came from, or the page exists when the chart came from no page, nothing is written. The editor says who saved it and when, links the history, and keeps your edits in this browser.
- The edit also goes with `baserevid` (or `createonly` for a new page), so MediaWiki itself sees the base.
- After a save, the song's revision moves to the new one, so the next save works.

Stacked on #26, which makes every song's chart come from the wiki. #26 removes the stale copies; this PR makes sure a save can't overwrite a page that changed since you loaded it. Tests: four new ones for saveMetadata, 163/163 on this branch; build clean. The preview can't save, so a real save needs checking on the live site once this is deployed.

Deploy: redeploy pickipedia after merge (with #26).
Worked on by: magent, skyler, justin, in #rabbithole