* Finds the highest task ID ever assigned, considering both existing files * and the high water mark (for deleted/reset tasks).
(taskListId: string)
| 269 | * and the high water mark (for deleted/reset tasks). |
| 270 | */ |
| 271 | async function findHighestTaskId(taskListId: string): Promise<number> { |
| 272 | const [fromFiles, fromMark] = await Promise.all([ |
| 273 | findHighestTaskIdFromFiles(taskListId), |
| 274 | readHighWaterMark(taskListId), |
| 275 | ]) |
| 276 | return Math.max(fromFiles, fromMark) |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Creates a new task with a unique ID. |
no test coverage detected