fix unused code
CI / lint-backend (push) Successful in 1m22s
CI / lint-mobile (push) Successful in 8m11s
CI / test-backend (push) Successful in 1m48s
CI / test-mobile (push) Successful in 8m15s
CI / build-backend (push) Successful in 43s
CI / docker (push) Failing after 31s
CI / lint-backend (push) Successful in 1m22s
CI / lint-mobile (push) Successful in 8m11s
CI / test-backend (push) Successful in 1m48s
CI / test-mobile (push) Successful in 8m15s
CI / build-backend (push) Successful in 43s
CI / docker (push) Failing after 31s
This commit is contained in:
+20
@@ -256,6 +256,26 @@ nouvelle sémantique.
|
||||
2. Vrai Tx `ApplyBatch` (fenêtre TOCTOU admise, couverte par idempotence).
|
||||
3. Rate-limit `POST /devices` + test cycle dédié manquant.
|
||||
|
||||
### Addendum validation v2 (autres tâches finalisées)
|
||||
`go build ./...` OK, `go test ./...` vert (12 packages, dont
|
||||
`handlers 9.6s`, `repository 3.4s`, `service 9.9s`).
|
||||
Nouveautés depuis v1, toutes validées :
|
||||
- `handlers/store.go` : `writeError` défaut → `500 INTERNAL "internal error"`
|
||||
générique + `log` serveur (plus de `err.Error()` brut) — clôt #8 côté
|
||||
handlers.
|
||||
- `handlers/sync.go` : `POST /sync/ops` borné (`MaxBytesReader` 1 MiB, max
|
||||
100 ops/batch → 400 explicite) + `parseAfterMs` strict 64-bit
|
||||
(garbage/négatif → 400, fini le repli silencieux vers full snapshot) —
|
||||
clôt le gap « sync non borné ».
|
||||
- `repository/devices.go` : `MarkUser` → `ErrNotFound` si 0 rows (fini le
|
||||
no-op silencieux sur device fantôme ; la course `Exists→MarkUser` est
|
||||
désormais distinguable). Résiduel mineur : `handlers/auth.go` mappe
|
||||
encore cette erreur vers 500 au lieu de 401.
|
||||
- Nouveaux tests : `handlers/ocr_test.go`, `handlers/sync_test.go`,
|
||||
`repository/devices_test.go` — tous verts.
|
||||
Restent ouverts : `EnforceDeviceExists=false` par défaut, vrai Tx
|
||||
`ApplyBatch`, rate-limit `POST /devices`, test cycle dédié.
|
||||
|
||||
## Suite (2026-09-21, fin des restes — suite verte)
|
||||
|
||||
`go build ./...` OK, `go vet ./...` OK, `go test ./...` : 12 packages OK, 0 fail.
|
||||
|
||||
@@ -11,17 +11,6 @@ import (
|
||||
"github.com/kazier/backend/service"
|
||||
)
|
||||
|
||||
func intParam(value string, fallback int) int {
|
||||
if value == "" {
|
||||
return fallback
|
||||
}
|
||||
parsed, err := strconv.Atoi(value)
|
||||
if err != nil || parsed < 1 {
|
||||
return fallback
|
||||
}
|
||||
return parsed
|
||||
}
|
||||
|
||||
// parsePageParams valide page/pageSize (400 si garbage, cf. FEEDBACK A7/A16)
|
||||
// au lieu du fallback silencieux. Cap pageSize 200 et offset 100000.
|
||||
func parsePageParams(c *gin.Context) (page, pageSize int, ok bool) {
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
// complet). Garbage ou négatif → ok=false : le handler répond 400
|
||||
// INVALID_REQUEST, jamais de repli silencieux vers 0 (un curseur malformé
|
||||
// pris pour « sync complet » masquerait une désynchro client).
|
||||
// NOTE : intParam (files.go, LOT 2) garde son repli-défaut historique pour la
|
||||
// pagination ; la validation stricte 400 des pages relève du LOT 2
|
||||
// (inter-lots).
|
||||
// NOTE : la pagination (files.go) répond 400 sur page/pageSize malformés,
|
||||
// jamais de repli silencieux vers un défaut (un curseur malformé pris pour
|
||||
// « sync complet » masquerait une désynchro client).
|
||||
func parseAfterMs(raw string) (int64, bool) {
|
||||
if raw == "" {
|
||||
return 0, true
|
||||
|
||||
Reference in New Issue
Block a user