Define behavior when several X-Bz-Test-Mode options are enabled
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- backend-api-design, testing
Direzione di ricerca
Start with base/base.go at addHeaders and the request paths makeRequest and DownloadFileByName; read the README section and the review context in #49. First determine how B2 handles repeated or comma-separated X-Bz-Test-Mode values, using a live account or asking Backblaze. Then add httptest coverage for each option and combinations, including ForceCapExceeded() on upload and download; done when tests assert the sent headers and the README records the verified behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Enabling more than one test-mode option sends several X-Bz-Test-Mode header lines, and Backblaze does not document that this works. Raised in review on #49.
addHeaders (base/base.go:270) uses req.Header.Add("X-Bz-Test-Mode", ...) for each enabled option. FailSomeUploads(), ExpireSomeAuthTokens() and ForceCapExceeded() can all be passed to b2.NewClient (and base.AuthorizeAccount), so combining them produces up to three separate X-Bz-Test-Mode header lines on every request. Backblaze's Integration Checklist documents each value on its own and says nothing about combining values, by comma or by repeated headers, so what B2 does with repeated lines is unknown: it may honour all, honour only the first or last, or reject the request.
Two related facts from the same review:
- The header is set once at client construction and sent on every request the client makes (all JSON calls through
makeRequestatbase/base.go:446, includingb2_authorize_account, andDownloadFileByNameatbase/base.go:1273). There is no way to turn it off for one call. ForceCapExceeded()has no caller or test anywhere in the repo, so the cap-exceeded path has never been exercised.
#49 documents all of this and tells users to prefer one option per client unless they have verified the combination. blazer's own live tests (startLiveTest, b2/integration_test.go) already combine FailSomeUploads() and ExpireSomeAuthTokens(), but that does not establish that every combination, including all three, is supported by B2. This issue is about making the behavior defined rather than only documented with a caveat.
What is needed:
- Find out what B2 does with repeated
X-Bz-Test-Modelines and with a comma separated value, using a live account (and ask Backblaze if the docs stay silent). - Based on the result, either send a single combined header in the form B2 accepts, or reject more than one option with a clear error at client construction, or keep the current behavior and keep the README caveat. Record the finding in the README section.
- Add a unit test with an
httptestserver that checks the exactX-Bz-Test-Modeheader lines sent for each single option and for combined options. - Add a test that
ForceCapExceeded()sends its header on an upload and a download request. - Switch from
Header.AddtoHeader.Setif combining is rejected or folded into one value.
Acceptance checks:
- The header lines sent for each option and for combinations are asserted by tests, not only documented.
- The README section matches what the live check showed, and the "verify the combination you need" caveat is removed or replaced with the verified behavior.
- No change to behavior when exactly one option is enabled.
Related: #49, #36.
- Lingua principale
- Go
- Stelle
- 66
- Fork
- 18
- Merge medio
- 1g 10h
- PR unite (30g)
- 132
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Backblaze/blazer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Bucket.Attrs never returns ReplicationConfig: replication configuration is write-onlyForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
test: skip the fuzz non-vacuity guard when replaying a single seedForse già presa @ffumero2003 l’ha presa 5 giorni fa. Apertatesting
Backblaze/blazer#330 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Backblaze/blazer
Issue simili
-
needs-triage typo
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
llm-d-incubation/llm-d-scaling-manager#122 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue severity: low tech-debt
Difficoltà 2/5 Mezza giornata Idoneità per principianti 75/100
TMHSDigital/subenum#329 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Backend summarize min() / max() panics when a field has no numeric valuesForse già presa @weng5e l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
grafana/grafana-infinity-datasource#1832 ·
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
GillMacedo/godebugdiff#13 ·