{"record":{"id":"d0903dd698b75c92","repo":"redis/redis-py","slug":"xclaim-justid-must-be-a-boolean","errorCode":null,"errorMessage":"XCLAIM justid must be a boolean","messagePattern":"XCLAIM justid must be a boolean","errorType":"validation","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":7323,"sourceCode":"            if not isinstance(idle, int):\n                raise DataError(\"XCLAIM idle must be an integer\")\n            pieces.extend((b\"IDLE\", str(idle)))\n        if time is not None:\n            if not isinstance(time, int):\n                raise DataError(\"XCLAIM time must be an integer\")\n            pieces.extend((b\"TIME\", str(time)))\n        if retrycount is not None:\n            if not isinstance(retrycount, int):\n                raise DataError(\"XCLAIM retrycount must be an integer\")\n            pieces.extend((b\"RETRYCOUNT\", str(retrycount)))\n\n        if force:\n            if not isinstance(force, bool):\n                raise DataError(\"XCLAIM force must be a boolean\")\n            pieces.append(b\"FORCE\")\n        if justid:\n            if not isinstance(justid, bool):\n                raise DataError(\"XCLAIM justid must be a boolean\")\n            pieces.append(b\"JUSTID\")\n            kwargs[\"parse_justid\"] = True\n        return self.execute_command(\"XCLAIM\", *pieces, **kwargs)\n\n    @overload\n    def xdel(self: SyncClientProtocol, name: KeyT, *ids: StreamIdT) -> int: ...\n\n    @overload\n    def xdel(\n        self: AsyncClientProtocol, name: KeyT, *ids: StreamIdT\n    ) -> Awaitable[int]: ...\n\n    def xdel(self, name: KeyT, *ids: StreamIdT) -> int | Awaitable[int]:\n        \"\"\"\n        Deletes one or more messages from a stream.\n\n        Args:\n            name: name of the stream.","sourceCodeStart":7305,"sourceCodeEnd":7341,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/core.py#L7305-L7341","documentation":"Raised by Redis.xclaim() when justid is truthy but not a bool. Like force, the check runs only inside `if justid:`. justid returns only claimed IDs without message bodies.","triggerScenarios":"Calling r.xclaim(..., justid=1) or justid='true'. justid=True passes; falsy values skip the check.","commonSituations":"Using 1/0 or strings instead of True/False, or toggling justid from a config flag.","solutions":["Pass a real bool: justid=True/False.","Coerce config flags with bool()."],"exampleFix":"# before\nr.xclaim('s','g','c', 0, ['1-0'], justid=1)\n\n# after\nr.xclaim('s','g','c', 0, ['1-0'], justid=True)","handlingStrategy":"type-guard","validationCode":"if not isinstance(justid, bool):\n    raise TypeError('justid must be bool')","typeGuard":"lambda v: isinstance(v, bool)","tryCatchPattern":"from redis.exceptions import DataError\ntry:\n    r.xclaim('s','g','c', 0, ids, justid=j)\nexcept DataError as e:\n    log.warning('bad xclaim justid %r: %s', j, e)","preventionTips":["Use True/False for justid; the truthy-only guard means justid=0 hides type mistakes."],"tags":["stream","xclaim","validation","boolean-coercion"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}