The Plague the Pets Carried — JavaScript Bug Hunt
Modelled on World of Warcraft's Corrupted Blood incident (September 2005): a debuff cast by the boss Hakkar in the new Zul'Gurub raid was meant to stay…
- Language: JavaScript
- Layer: Backend
- Difficulty: Easy
- Concepts: State
- Modelled on: World of Warcraft · 2005
- Visible tests: the player leaves clean and keeps ordinary debuffs; a dismissed pet is cleaned too
- Reward: 50 XP for a complete fix
Incident
- Severity: SEV-1 (priority: P0)
- Ticket: BUG-ZG-HAKKAR
- Reported by: every city on the realm
- Time to fix: 10 minutes, the target for an easy incident
Failing checks on the shipped build
- a dismissed pet is cleaned too — the pet must not carry the plague out: expected [{"name":"Hunter's Mark","zoneBound":false}] but got [{"name":"Corrupted Blood","zoneBound":true},{"name":"Hunter's Mark","zoneBound":false}]
How to work this incident
- Read the report: write down the expected behaviour and the actual one in a sentence each.
- Reproduce it: run the visible tests and find the failing check that matches the report.
- Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
- Follow the request through the handler, the validation and the service it calls; find the first step whose output disagrees with the report.
- Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.
Briefing
Modelled on World of Warcraft's Corrupted Blood incident (September 2005): a debuff cast by the boss Hakkar in the new Zul'Gurub raid was meant to stay inside that zone. But a hunter's pet that was dismissed while infected kept the debuff, and when it was summoned again in a capital city the plague spread from player to player across the world. Blizzard had to fix the mechanic and reset the servers.
This project is a reconstruction. zone.js strips zone-bound debuffs when a player leaves the instance — from the player, and from their pet only if the pet is currently summoned.
Fix leaveInstance so nothing the player owns leaves the zone still carrying a zone-bound debuff.
Bug report
BUG-ZG-HAKKAR · Priority: P0 · Reported by: every city on the realm
leaveInstance(world, playerId):
- removes every debuff with zoneBound: true from the player
- removes every zoneBound debuff from the player's pet (player.petId), whether the pet is summoned or dismissed; a player may have no pet (petId null)
- keeps every debuff that is not zone-bound, in its original order
- sets the player's zone to "world"
Observed: a pet dismissed inside Zul'Gurub still carries Corrupted Blood when summoned in Ironforge.
Logs
[zone] rexxar left zulgurub, debuffs cleared
[ironforge] misha summoned with Corrupted Blood
[ironforge] 214 players infected in 3 minutesThe code as shipped
src/raid/zone.js (editable)
function stripZoneBound(entity) {
entity.debuffs = entity.debuffs.filter(function (d) { return !d.zoneBound; });
}
exports.leaveInstance = function (world, playerId) {
var player = world.entities[playerId];
stripZoneBound(player);
if (player.petId && world.entities[player.petId].summoned) {
stripZoneBound(world.entities[player.petId]);
}
player.zone = "world";
};
Read-only context: src/raid/world.js.
Open the hunt to start the incident clock, edit the files, run the visible tests and submit against the hidden ones, then write the root cause down. More JavaScript bug hunts.