Skip to content

Commit

Permalink
fix(openapi): default upload method is now direct (#4277)
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Aug 30, 2023
1 parent 8e94059 commit 44846bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.3
info:
version: 3.2.4
version: 3.2.5
title: Common Data Types
description: |
\*****bzzz*****
Expand Down Expand Up @@ -982,10 +982,10 @@ components:
name: swarm-deferred-upload
schema:
type: boolean
default: "true"
default: "false"
required: false
description: >
Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred.
Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be direct.
responses:
"204":
Expand Down
2 changes: 1 addition & 1 deletion pkg/pushsync/pushsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream)

err = ps.store.ReservePutter().Put(ctx, chunkToPut)
if err != nil {
return fmt.Errorf("chunk store: %w", err)
return fmt.Errorf("reserve put: %w", err)
}

signature, err := ps.signer.Sign(chunkToPut.Address().Bytes())
Expand Down
2 changes: 1 addition & 1 deletion pkg/storer/internal/reserve/reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (r *Reserve) Put(ctx context.Context, store internal.Storage, chunk swarm.C
case err != nil:
return false, fmt.Errorf("load or store stamp index for chunk %v has fail: %w", chunk, err)
case loaded && item.ChunkIsImmutable:
return false, storage.ErrOverwriteOfImmutableBatch
return false, fmt.Errorf("batch %s index %s: %w", hex.EncodeToString(chunk.Stamp().BatchID()), hex.EncodeToString(chunk.Stamp().Index()), storage.ErrOverwriteOfImmutableBatch)
case loaded && !item.ChunkIsImmutable:
prev := binary.BigEndian.Uint64(item.StampTimestamp)
curr := binary.BigEndian.Uint64(chunk.Stamp().Timestamp())
Expand Down

0 comments on commit 44846bb

Please sign in to comment.