Skip to content

docs(remote): a null in a track correction is a removal, never an omission - #607

Merged
InstaZDLL merged 1 commit into
mainfrom
docs/track-patch-null-is-a-removal
Sep 11, 2026
Merged

docs(remote): a null in a track correction is a removal, never an omission#607
InstaZDLL merged 1 commit into
mainfrom
docs/track-patch-null-is-a-removal

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • The server's PATCH /tracks/{id} becomes a partial patch in three states (fix(api): a track correction leaves alone what it does not mention waveflow-server#184, fixing bug: a track PATCH drops every correction it does not mention waveflow-server#177): a field absent leaves its correction alone, null removes it, a value sets it.
  • This client's behaviour does not change. remote/drain.rs already spells every field out, null included, so an emptied field still reaches the server as a removal — against the new server and an older one alike. The server PR replays this client's request exactly as drain.rs sends it.
  • What changes is what the comments tell the next reader. They justified the explicit nulls by wholesale semantics, and read that way they invite skipping None fields — which against the new server would silently keep a correction the user had just emptied. They now say the nulls are load-bearing, and that the three fields the editor has no input for (sort_title, comment, musicbrainz_recording_id) are left alone rather than erased.

How I tested

  • The diff touches comment lines only: filtering every // line out of git diff leaves nothing.
  • rustfmt --edition 2021 --check on both files, with the repository's rustfmt.toml: exit 0, so the doc-comment syntax is valid and the formatting unchanged.
  • The behaviour the comments describe is tested on the server side in fix(api): a track correction leaves alone what it does not mention waveflow-server#184, proven by inverting each half of the change.

Checklist

  • Title uses Conventional Commits (type(scope): subject, kebab-case scope)
  • bun run lint + bun run typecheck — not run: no TypeScript touched
  • cargo check --manifest-path src-tauri/Cargo.toml --all-targets — not run locally: comment-only change, syntax checked with rustfmt --check instead; CI runs the full check
  • UI strings / locales — not applicable, none changed
  • CLAUDE.md and docs/ — not applicable, no cross-cutting pattern changed
  • Breaking change — none, comment-only

Linked issues

Refs InstaZDLL/waveflow-server#177
Refs InstaZDLL/waveflow-server#184

Best merged after InstaZDLL/waveflow-server#184: until then the comments describe server semantics that are not deployed yet. The rule they state — never omit a None field — is safe against either.

Summary by CodeRabbit

  • Correctifs
    • Les mises à jour des métadonnées des pistes appliquent désormais correctement les modifications partielles.
    • L’envoi explicite d’une valeur vide supprime la correction correspondante.
    • Les champs omis restent inchangés, évitant la suppression involontaire de métadonnées existantes.
    • Les champs non pris en charge ne modifient pas les corrections ajoutées par d’autres clients.

…ssion

The server is changing PATCH /tracks/{id} from wholesale to a partial
patch in three states: absent leaves a correction alone, null removes
it, a value sets it (InstaZDLL/waveflow-server#177).

What this client sends keeps its meaning. drain.rs already spells every
field out, null included, so an emptied field still reaches the server
as a removal. What changes is what the comments tell the next reader.
They justified the explicit nulls and the absent clear_* verbs by
wholesale semantics, and read that way they permit an optimisation —
skip the None fields — that would now silently keep a correction the
user had just emptied.

The comments now say why the nulls are load-bearing under the new
contract, and that the three fields the editor has no input for are
left alone rather than erased, which is the bug the server change
fixes. The explicit nulls behave the same against a server from before
it.

Comment-only. No behaviour changes against either server version.

Claude-Session: https://claude.ai/code/session_019coGCzcX775GmG9kYz8fft
@InstaZDLL InstaZDLL added scope: backend Rust/Tauri backend (src-tauri/) type: docs Documentation size: m 50-200 lines labels Sep 11, 2026
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b7767cf1-776e-49fa-aba4-5701a823aa35

📥 Commits

Reviewing files that changed from the base of the PR and between 287db97 and a5d8fe0.

📒 Files selected for processing (2)
  • src-tauri/crates/app/src/remote/drain.rs
  • src-tauri/crates/app/src/remote/mutation.rs

Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

La documentation de UpdateTrackMetadata décrit maintenant un comportement PATCH incrémental. Les champs absents restent inchangés. Les valeurs None sont envoyées comme null pour supprimer une correction.

Changes

Métadonnées de piste

Layer / File(s) Summary
Contrat PATCH et documentation du flux
src-tauri/crates/app/src/remote/mutation.rs, src-tauri/crates/app/src/remote/drain.rs
La documentation précise les trois états d’un champ : absent, null ou valeur définie. Les champs non pris en charge restent inchangés lorsqu’ils sont omis.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to a5d8f

This documentation update does not change runtime behavior and accurately describes the existing metadata patch contract.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed Le titre décrit précisément la modification principale : la distinction entre une valeur null qui supprime une correction et un champ omis. Il suit aussi le format Conventional Commits avec le scope…
Description check ✅ Passed La description respecte la structure attendue. Elle explique le changement, le comportement client, les tests réalisés, les éléments non applicables et les issues liées. Les commandes non exécutées so…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/track-patch-null-is-a-removal

Comment @coderabbitai help to get the list of available commands.

@InstaZDLL InstaZDLL self-assigned this Sep 11, 2026
@InstaZDLL
InstaZDLL merged commit 443d91d into main Sep 11, 2026
16 checks passed
@InstaZDLL
InstaZDLL deleted the docs/track-patch-null-is-a-removal branch September 11, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) size: m 50-200 lines type: docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant