(self, session_id: str)
| 90 | return self._dir / f"{session_id}-state.json" |
| 91 | |
| 92 | async def _read_items(self, session_id: str) -> list[Any]: |
| 93 | file_path = self._items_path(session_id) |
| 94 | try: |
| 95 | data = await asyncio.to_thread(file_path.read_text, "utf-8") |
| 96 | parsed = json.loads(data) |
| 97 | return parsed if isinstance(parsed, list) else [] |
| 98 | except FileNotFoundError: |
| 99 | return [] |
| 100 | |
| 101 | async def _write_items(self, session_id: str, items: list[Any]) -> None: |
| 102 | file_path = self._items_path(session_id) |
no test coverage detected