Repository navigation
Conversation
A work package can carry label names next to label ids. The names are resolved or created inside the save transaction, so an abandoned form leaves no label behind and the contract rejects names the user may not create before anything is written.
A `_links.labels` entry with a null href and a title is a label to create on save; the form endpoints echo it back without persisting.
The autocompleter keeps a new label as a local pending item and the work package payload sends it as a titled link without href.
The form echo and the contract looked a label up per name; both now match all names at once with the case folding done in Postgres.
Deploying openproject with ⚡ PullPreview
|
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
The create service ignored the result of its unvalidated save, so an aborted label creation needed a raise to avoid a silent success and ended in a 500. Honouring the save result turns it into the same 422 the update path gives.
Names that already exist are filtered in one query, so uniqueness and the permission lookup no longer run once per pending name on every form refresh.
A pending label and a persisted label with the same name are the same label, since the backend identifies labels by their lower-cased name.
Without a labels link on the reference the base changeset writes raw resources into the payload and the pending titles were lost.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://community.openproject.org/wp/81938
A label typed into the work package form used to be created the moment "Create label" was picked, so an abandoned form left a ghost label behind that every editor could pick and admins saw in the labels list. Now the autocompleter keeps the new label as a local pending item, the work package payload sends it as a
_links.labelsentry with a nullhrefand the name astitle, and the backend finds or creates it inside the save transaction. The form endpoints echo such entries back without persisting anything, so a pending label survives form refreshes on the create form, and the contract rejects names the user may not create (same gate asPOST /api/v3/labels) before anything is written. Bulk edit and move/copy forms get the same in a stacked follow-up.