[GH-ISSUE #994] fake-gcs-server does not respect ifGenerationMatch #156

Open
opened 2026-03-03 12:08:48 +03:00 by kerem · 2 comments
Owner

Originally created by @bentheiii on GitHub (Nov 27, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/994

It would appear that live objects are being modified even with ifGenerationMatch=0

steps to reproduce:

  • create a new empty bucket standard.
  • send the following request:
    POST /upload/storage/v1/b/standard/o?ifGenerationMatch=0&name=my-file.txt.json.final.zip.zip&uploadType=media
    
    with the body 0
  • confirm that the file's value is up-to-date
    GET /storage/v1/b/standard/o/my-file.txt.json.final.zip.zip?alt=media
    
    you should get 0
  • send the upload request again
    POST /upload/storage/v1/b/standard/o?ifGenerationMatch=0&name=my-file.txt.json.final.zip.zip&uploadType=media
    
    this time with body 1
  • confirm that the file's value has been changed
    GET /storage/v1/b/standard/o/my-file.txt.json.final.zip.zip?alt=media
    
    you should get 1
Originally created by @bentheiii on GitHub (Nov 27, 2022). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/994 It would appear that live objects are being modified even with `ifGenerationMatch=0` steps to reproduce: * create a new empty bucket `standard`. * send the following request: ``` POST /upload/storage/v1/b/standard/o?ifGenerationMatch=0&name=my-file.txt.json.final.zip.zip&uploadType=media ``` with the body `0` * confirm that the file's value is up-to-date ``` GET /storage/v1/b/standard/o/my-file.txt.json.final.zip.zip?alt=media ``` you should get `0` * send the upload request again ``` POST /upload/storage/v1/b/standard/o?ifGenerationMatch=0&name=my-file.txt.json.final.zip.zip&uploadType=media ``` this time with body `1` * confirm that the file's value has been changed ``` GET /storage/v1/b/standard/o/my-file.txt.json.final.zip.zip?alt=media ``` you should get `1`
Author
Owner

@fsouza commented on GitHub (Nov 27, 2022):

@bentheiii which backend are you using? memory or filesystem? If the filesystem, what's your OS?

<!-- gh-comment-id:1328301208 --> @fsouza commented on GitHub (Nov 27, 2022): @bentheiii which backend are you using? memory or filesystem? If the filesystem, what's your OS?
Author
Owner

@bentheiii commented on GitHub (Dec 6, 2022):

Hi @fsouza , I am using the default docker backend (filesystem), the OS is windows though docker.

<!-- gh-comment-id:1338956287 --> @bentheiii commented on GitHub (Dec 6, 2022): Hi @fsouza , I am using the default docker backend (filesystem), the OS is windows though docker.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#156
No description provided.