{
  "slug": "node-redis-watch-conflict",
  "version": 1,
  "project": "node-redis",
  "title": "Redis WATCH conflict between two connections",
  "description": "One connection watches and reads a key. Another connection changes it before MULTI and EXEC. Redis returns a null EXEC reply, so none of the queued writes execute; Node Redis exposes this as WatchError.",
  "config": {
    "design": "sequence-lifelines-ordered-labeled-messages",
    "name": "watch-conflict",
    "style": "clean",
    "palette": [
      "#975c45"
    ],
    "parameters": {
      "participants": [
        {
          "id": "a",
          "label": "Watched connection",
          "description": "One pool.execute() callback",
          "icon": "tabler:lock"
        },
        {
          "id": "redis",
          "label": "Redis server",
          "description": "Tracks watched keys",
          "icon": "tabler:database"
        },
        {
          "id": "b",
          "label": "Another connection",
          "description": "Updates the same key",
          "icon": "tabler:code"
        }
      ],
      "messages": [
        {
          "from": "a",
          "to": "redis",
          "label": "WATCH key"
        },
        {
          "from": "a",
          "to": "redis",
          "label": "GET key"
        },
        {
          "from": "redis",
          "to": "a",
          "label": "Current value",
          "kind": "reply"
        },
        {
          "from": "b",
          "to": "redis",
          "label": "SET key (new value)"
        },
        {
          "from": "a",
          "to": "redis",
          "label": "MULTI \u2026 EXEC"
        },
        {
          "from": "redis",
          "to": "a",
          "label": "Null EXEC reply",
          "kind": "reply"
        }
      ]
    },
    "accessibility": {
      "title": "Redis WATCH conflict between two connections",
      "description": "One connection watches and reads a key. Another connection changes it before MULTI and EXEC. Redis returns a null EXEC reply, so none of the queued writes execute; Node Redis exposes this as WatchError."
    }
  },
  "files": {
    "svg": {
      "url": "/diagram-sources/node-redis-watch-conflict/v1/diagram.svg",
      "sha256": "cb0f129c36885da48bc48c36b94817da91ba6a5f4f5bb5345d914a14445d8dba"
    },
    "png": {
      "url": "/diagram-sources/node-redis-watch-conflict/v1/diagram.png",
      "sha256": "984364f079a22fc60cd9510767d983bec7be09c038d128c43062385d4315f38e"
    }
  }
}
