{"id":"XE-0079","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"79","source_url":"https://github.com/xeprotocol/xe/issues/79","reporter_id":25,"title":"api: GET /leases invalid state error lists five states and omits the valid \"expired\" (Minor)","area":"node-api","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"accepted","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:22.641934+00:00","updated_at":"2026-11-10T11:38:20.448810+00:00","source_created_at":"2026-10-26T20:34:32+00:00","told_at":"2026-11-10T00:15:38+00:00","status_changed_at":"2026-10-29T14:04:12.839249+00:00","url":"https://bounty.xe.network/XE-0079","body":"- Suggested tier: Minor (\"misleading log messages\")\n- Area: HTTP API `/leases`\n- Found: 2026-10-26, node `xe/92d83d1`, repo master `9787859`\n\n## Summary\n\n`GET /leases?state=<bad>` answers:\n\n```\n400 {\"error\":\"invalid state: must be one of created, accepted, settled, cancelled, unfulfilled\"}\n```\n\nThe message leaves out `expired`, which is a valid filter: it is in `core.ValidLeaseStates` (`core/types.go:194`), in the OpenAPI enum for `state`, in the docs (\"Filter with ?state=created|accepted|settled|cancelled|unfulfilled|expired\"), and `GET /leases?state=expired` returns 200. A user or agent that reads the error to correct its request is told `expired` does not exist.\n\n## Steps to reproduce\n\n```sh\ncurl -s 'https://test.network/api/v1/leases?state=bogus'     # message lists 5 states\ncurl -s 'https://test.network/api/v1/leases?state=expired' -o /dev/null -w '%{http_code}\\n'   # 200\n```\n\nSame message from the node directly (`https://ldn.core.test.network/leases?state=bogus`).\n\n## Cause\n\nThe string is hardcoded in `handleGetLeases` (`api/handler.go`) and was not updated when `LeaseExpired` was added.\n\n## Suggested fix\n\nBuild the message from `core.ValidLeaseStates`, or add `expired` to the string.\n\n## Payout\n\nXE address: `6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc` (same as #75).\n","patch_refs":[{"id":133,"repo":"xeprotocol/xe","kind":"pr","ref":"113","title":"fix(api): include expired in invalid lease state error message (#79)","url":"https://github.com/xeprotocol/xe/pull/113","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"}],"thread":[{"id":27,"source":"github","source_ref":"6462626078","author":"arturbarszcz78","team":false,"body":"[comment from a blocked account removed]","created_at":"2026-10-28T06:48:33+00:00"},{"id":1567,"source":"github","source_ref":"6755091464","author":"XE desk","team":true,"body":"Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is\nupdated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0079.","created_at":"2026-11-10T00:15:38+00:00"}]}