| โฆ | โฆ | @@ -0,0 +1,134 @@ | |
| 52 | + | return null; | |
| 53 | + | } | |
| 54 | + | const scope = draftKey.slice(NEW_TASK_DRAFT_PREFIX.length); | |
| 55 | + | const separator = scope.lastIndexOf(":"); | |
๐ก Medium state/pending-new-tasks-model.ts:55
parseNewTaskDraftKey misidentifies the project for valid keys containing colons: new-task:env:project:part is parsed as environment env:project and project part, so the draft is grouped and opened against the wrong project and cannot be reached from its list row. Splitting at the last colon cannot disambiguate IDs that both allow colons; serialize the environment and project components with an unambiguous encoding and update the corresponding key producer/parser.
๐ Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/mobile/src/state/pending-new-tasks-model.ts around line 55: |
| 2 | |
| 3 | `parseNewTaskDraftKey` misidentifies the project for valid keys containing colons: `new-task:env:project:part` is parsed as environment `env:project` and project `part`, so the draft is grouped and opened against the wrong project and cannot be reached from its list row. Splitting at the last colon cannot disambiguate IDs that both allow colons; serialize the environment and project components with an unambiguous encoding and update the corresponding key producer/parser. |
Not changing this. Both ids are server-generated UUIDs (crypto.randomUUIDv4 in ServerEnvironment.ts and serverRuntimeStartup.ts/cli/project.ts), so neither can contain a colon. The new-task:<env>:<project> key is the pre-existing persisted format written by new-task-flow-provider.tsx, and composerDraftEnvironmentId in composerAttachmentUploadQueue.ts already parses it with the same last-colon split; this parser mirrors that. Changing the encoding would orphan every draft already on users' devices for a case that cannot occur.