Repository navigation
Conversation
Updating a drive with an empty name ("name": "") succeeded and silently
kept the old name, because the name was only validated when it was
non-empty. Validate it whenever the request contains it, so an empty
name is rejected with 400 like on create. A request without a name, or
with "name": null, still leaves the name unchanged.
Space names were trimmed with strings.TrimSpace, which only removes
Unicode whitespace. Invisible formatting characters such as the
zero-width space (U+200B), the word joiner (U+2060) or the byte order
mark (U+FEFF) aren't whitespace, so a name made only of them was
accepted on create and on update, and showed up as an empty name in
every client. Trim these characters from both ends of the name as
well. Inside a name they are still allowed, since some of them are
needed there, e.g. the zero-width joiner in emoji sequences.
Assisted-by: Claude Code:claude-opus-5-5
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
🟢 Coverage 100.00% diff coverage · +0.02% coverage variation
Metric Results Coverage variation ✅ +0.02% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (83615f2) Report Missing Report Missing Report Missing Head commit (0e26528) 92644 (+4) 25440 (+22) 27.46% (+0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3946) 7 7 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Updating a drive with
"name": ""succeeded and silently kept the old name, because the name was only validated when it was non-empty. It is now validated whenever the request contains it, so an empty name gets 400, as on create. A request without a name, or with"name": null, still leaves the name unchanged.Space names were trimmed with
strings.TrimSpace, which only removes Unicode whitespace. Invisible formatting characters such as the zero-width space (U+200B), the word joiner (U+2060) or the byte order mark (U+FEFF) aren't whitespace, so a name made only of them was accepted on create and on update, and showed up as an empty name in clients. They are now trimmed from both ends of the name as well. Inside a name they are still allowed, e.g. the zero-width joiner in emoji sequences.Tests
changeSpaces.feature. They pass on posix and decomposed.AI assistance: Claude Code (claude-opus-5-5) wrote the first draft of the code and the tests; the change was reviewed by the author.