Skip to content

Instantly share code, notes, and snippets.

@cdrini
Last active April 15, 2019 04:03
Show Gist options
  • Save cdrini/9ee2c78da213b38262b02bbd9e35b1b4 to your computer and use it in GitHub Desktop.
Save cdrini/9ee2c78da213b38262b02bbd9e35b1b4 to your computer and use it in GitHub Desktop.
OL Cached Changes Bug Investigation

Try to find the commit that introduced the bug

Notes: https://coda.io/d/OL-Caching-Bug-Investigation_dglSLSKf2l1/_suyCn

Methodology

  1. Checkout the commit in question (e.g. git checkout d3f63c1)
  2. Run the script to make sure the environment is set up (bash scripts/run-bisect.sh)
  3. I try to do a curl-edit (below) but it didn't work.
  4. Go to the home page; click on the first book (Complete works of mark twain), click on its first edition
  5. edit the edition to include some garbage text after the title and hit enter to save
  6. click on "History" to see if it saved correctly.

Note:

  • I was logged into the admin account. I cleared the cookies for one of the tests to see if it made a difference, but it didn't, so didn't bother doing it again.
  • When I went back far enough I had to also run cd docker.
#!/usr/bin/env bash
set -o xtrace
# Shut down if still running
docker-compose down
# Rebuild docker
time docker build -t olbase:latest -f docker/Dockerfile.olbase .
time docker build -t oldev:latest -f docker/Dockerfile.oldev .
time docker build -t olsolr:latest -f docker/Dockerfile.olsolr .
# cd docker
# Start docker
time docker-compose up -d
# Rebuild npm stuff
time docker-compose exec web npm install
time docker-compose exec web make js css
time docker-compose exec web npm run-script build-assets
curl "http://192.168.99.100:8080/authors/OL18319A/Mark_Twain/edit" -X POST --compressed -H "Content-Type: application/x-www-form-urlencoded" --data "author--name=$(date +%s)&_save="
echo "http://192.168.99.100:8080/authors/OL18319A?m=history"
sleep 20
# Check to see if it worked
LATEST_REV=$(curl -s "http://192.168.99.100:8080/authors/OL18319A.json" | jq '.latest_revision')
if [[ ${LATEST_REV} -eq 1 ]]; then
echo "STILL BROKEN";
else
echo "NOT BROKEN";
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment