Skip to content

fix(server-v2): harden real-library compatibility - #85

Merged
InstaZDLL merged 4 commits into
mainfrom
codex/real-library-hardening
Aug 9, 2026
Merged

fix(server-v2): harden real-library compatibility#85
InstaZDLL merged 4 commits into
mainfrom
codex/real-library-hardening

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Résumé

  • ferme la validation réelle Symfonium avec les adaptations de découverte, getBookmarks et search3 query=""
  • rend les jetons natifs wfapi_ utilisables par /api/v2, avec révocation, expiration, compte désactivé et suivi d'utilisation amorti
  • ajoute la pagination de la bibliothèque native afin d'exposer les catalogues de plus de 500 pistes
  • réduit le bruit des tags MP4 optionnels vides et documente la validation sur 2 859 fichiers réels

Validation

  • scan en lecture seule : 2 859/2 859 fichiers, 0 erreur (AAC/M4A, MP3, FLAC, WAV)
  • HTTP Range natif validé sur les quatre codecs
  • transcodage FLAC vers Opus 64 kbit/s validé
  • bun --cwd=webapp run test (5 tests)
  • bun --cwd=webapp run build
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo check --all-targets --all-features
  • cargo test --all-features (33 tests)

Notes

  • aucun tag de release n'est créé par cette PR
  • Cargo.lock et bun.lock locaux sont volontairement exclus

Summary by CodeRabbit

  • Nouvelles fonctionnalités

    • Ajout de la pagination de la liste des pistes avec offset et limit, jusqu’à 500 résultats par requête.
    • Prise en charge des jetons bearer longue durée pour les clients natifs et API.
    • Compatibilité renforcée avec Symfonium : découverte, recherches globales et récupération des favoris.
  • Corrections

    • Validation améliorée des jetons API actifs et révocables.
    • Rejet des paramètres de pagination invalides.
    • Réduction par défaut de certains avertissements MP4.
  • Documentation

    • Mise à jour du guide de démarrage, de la compatibilité client et du suivi des jalons M3/M4.

Signed-off-by: InstaZDLL <github.105mh@8shield.net>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review 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: Pro Plus

Run ID: b37d0701-0ee0-4da7-852e-1d1a8718d6ac

📥 Commits

Reviewing files that changed from the base of the PR and between 378c7f7 and 7a9f3f9.

📒 Files selected for processing (4)
  • docs/M4-handoff.md
  • src/catalog.rs
  • src/database.rs
  • tests/v2_foundations.rs

📝 Walkthrough

Walkthrough

Le changement ajoute l’authentification par jeton wfapi_, la pagination des pistes et les adaptations Subsonic requises par Symfonium. Les tests couvrent la révocation, la pagination, la découverte, getBookmarks et search3.

Changes

Compatibilité Waveflow v2

Layer / File(s) Summary
Authentification par jeton API
src/database.rs, src/authentication.rs, tests/v2_foundations.rs, README.md
Les jetons wfapi_ utilisent leur empreinte pour rechercher un compte actif. last_used_at est mis à jour au plus une fois par minute. Les tests couvrent l’authentification et la révocation.
Pagination de la navigation des pistes
src/http.rs, src/catalog.rs, tests/v2_foundations.rs, README.md
L’endpoint accepte offset et limit. Il rejette les valeurs invalides. Les requêtes SQL appliquent LIMIT et OFFSET avec un tri stable.
Compatibilité Subsonic Symfonium
src/subsonic.rs, docs/rfcs/RFC-002-waveflow-server-v2.md, tests/v2_foundations.rs, docs/subsonic-compatibility.md, docs/M3-symfonium-validation.md
Le serveur reconnaît la sonde GET ping exacte de Symfonium, renvoie un conteneur vide pour getBookmarks et traite search3 avec une requête vide comme une recherche complète.
Validation et transfert de livraison
docs/M4-handoff.md, README.md, src/main.rs
Les documents clôturent M3 et M4, décrivent le scan de bibliothèque et maintiennent l’interdiction de créer un tag de release sans demande explicite. Le filtre par défaut masque les avertissements MP4 concernés.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant authenticate
  participant Database
  Client->>authenticate: Jeton wfapi_
  authenticate->>Database: account_by_api_token_hash
  Database-->>authenticate: AccessRecord
  authenticate-->>Client: Requête authentifiée
Loading
sequenceDiagram
  participant Client
  participant list_tracks
  participant browse_tracks_for_user
  participant SQL
  Client->>list_tracks: offset, limit, query
  list_tracks->>browse_tracks_for_user: Paramètres validés
  browse_tracks_for_user->>SQL: LIMIT et OFFSET
  SQL-->>Client: Pistes paginées
Loading
sequenceDiagram
  participant Symfonium
  participant Subsonic
  participant Catalog
  Symfonium->>Subsonic: GET ping exact
  Subsonic-->>Symfonium: Réponse HTTP 200
  Symfonium->>Subsonic: search3 avec requête vide
  Subsonic->>Catalog: Recherche complète
  Catalog-->>Symfonium: Résultats du catalogue
Loading

Possibly related PRs

  • InstaZDLL/waveflow-server#83 — Modifie les mêmes composants d’authentification, de catalogue, d’API HTTP et de compatibilité Subsonic.

Suggested labels: scope: auth, scope: api

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Le titre résume clairement l’objectif principal de la PR : renforcer la compatibilité du serveur v2 avec des bibliothèques réelles.
Description check ✅ Passed La description couvre le résumé, les changements, la validation et les notes, malgré des intitulés et cases à cocher différents du modèle.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/real-library-hardening

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

@github-actions github-actions Bot added type: fix Bug fix scope: server Server core (Rust) scope: docs Docs, README, assets size: m 50-200 lines and removed type: fix Bug fix labels Aug 9, 2026
Comment thread tests/v2_foundations.rs Fixed
@InstaZDLL InstaZDLL self-assigned this Aug 9, 2026
Signed-off-by: InstaZDLL <github.105mh@8shield.net>
@github-actions github-actions Bot added the type: fix Bug fix label Aug 9, 2026
Signed-off-by: InstaZDLL <github.105mh@8shield.net>
@github-actions github-actions Bot added type: fix Bug fix and removed type: fix Bug fix labels Aug 9, 2026
@InstaZDLL
InstaZDLL marked this pull request as ready for review August 9, 2026 09:17
@github-actions github-actions Bot added type: fix Bug fix and removed type: fix Bug fix labels Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/M4-handoff.md`:
- Around line 11-14: Synchroniser la section « Ce qui reste » avec le statut M3
déjà déclaré fermé dans le handoff : remplacer les éléments indiquant « Clore M3
», une validation Symfonium incomplète ou une PR encore à fusionner par l’état
réellement finalisé, tout en conservant uniquement les actions encore
pertinentes pour M4.

In `@src/catalog.rs`:
- Around line 621-632: Ajoutez t.id comme critère de tri final dans les clauses
ORDER BY des deux requêtes du bloc rows, après rank pour la recherche FTS et
après t.title COLLATE NOCASE pour la liste normale, afin de garantir un ordre
total avant LIMIT/OFFSET. Ajoutez un test couvrant deux pistes portant le même
titre et vérifiez que leurs identifiants apparaissent sur des pages distinctes.

In `@tests/v2_foundations.rs`:
- Around line 232-237: Replace the direct SQL UPDATE in the test with a Database
token-revocation method that acquires the process-wide writer_guard before
mutating the database. Add or use this method on Database, then update the test
to invoke it while preserving the existing token hash and revocation timestamp
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4b9a5bc6-13cf-45c3-88a2-f1bc75f96fa6

📥 Commits

Reviewing files that changed from the base of the PR and between 5f4a2f2 and 378c7f7.

📒 Files selected for processing (12)
  • README.md
  • docs/M3-symfonium-validation.md
  • docs/M4-handoff.md
  • docs/rfcs/RFC-002-waveflow-server-v2.md
  • docs/subsonic-compatibility.md
  • src/authentication.rs
  • src/catalog.rs
  • src/database.rs
  • src/http.rs
  • src/main.rs
  • src/subsonic.rs
  • tests/v2_foundations.rs

Comment thread docs/M4-handoff.md
Comment thread src/catalog.rs
Comment thread tests/v2_foundations.rs Outdated
Signed-off-by: InstaZDLL <github.105mh@8shield.net>
@github-actions github-actions Bot added type: fix Bug fix size: l 200-500 lines and removed type: fix Bug fix size: m 50-200 lines labels Aug 9, 2026
@InstaZDLL
InstaZDLL merged commit 00b1305 into main Aug 9, 2026
14 checks passed
@InstaZDLL
InstaZDLL deleted the codex/real-library-hardening branch August 9, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs Docs, README, assets scope: server Server core (Rust) size: l 200-500 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants