Skip to content

Publishing a new desktop preview build fails with a Firestore read-after-write error #17845

Closed

Description

@singhharsh1708

Publishing a new desktop preview build fails with a 500, so a preview can never be registered.

POST /v2/desktop/previews/publish runs a Firestore transaction that stages the new manifest and then reads the slug pointer. Firestore does not allow a read after a write inside a transaction, so the client raises ReadAfterWriteError, the transaction rolls back, and the route returns 500. The Codemagic preview step calls this route with curl --fail, so the build fails there, and a retry fails the same way because the manifest never got created.

With the real google-cloud-firestore 2.20.0 client and only its gRPC API stubbed, publishing a new build on main returns 500 with ReadAfterWriteError: Attempted read after write in a transaction.

Fix in #17844.

Proposing this as a paid bounty ($25) per the contribution docs, @kodjima33.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Sep 23, 2026
  2. gdz56 commented on Sep 24, 2026

    @gdz56

    I'd like to take this one. Plan: reorder the Firestore transaction to read the slug pointer before staging the manifest write (reads first, writes after), so the ReadAfterWriteError goes away and the publish route returns 200. Will submit a PR shortly — happy to proceed as a bounty if confirmed. Thanks!

  3. added a commit that references this issue on Sep 24, 2026
    153736c
  4. added a commit that references this issue on Sep 29, 2026
    461f50f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions