Refactor: Dokument-Tags über IDs statt Namen round-trippen (Follow-up zu #730) #732
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Explicitly out-of-scope follow-up from #730. Today the document edit form round-trips tag names (
tags.map(t => t.name).join(','),frontend/src/routes/documents/[id]/edit/+page.server.ts:89), and the backend re-resolves each name to a tag on every save viaTagService.findOrCreate. #730 made that resolution unambiguous and non-throwing (exact-case → lowest-id CI → create), but name-as-key is still a smell: under a case collision, free-text authoring binds the bare wordweihnachtento the deep child andWeihnachtento the parent container — correct for the edit round-trip, but the author can't see which they'll get.Round-tripping tag IDs instead of names removes the ambiguity at the source: resolution becomes a direct
findById, no name matching, no collision handling needed on the edit path.Scope
DocumentUpdateDTO/DocumentBulkEditDTOand resolve viatagRepository.findById; keepfindOrCreate(name)only for genuinely new free-text tags (create-by-name path).Related
Notes
npm run generate:api). #730's lookup fix is the minimal correct unblock; this is the cleaner long-term shape.