Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(assets): group asset patches per document #4

Merged
merged 1 commit into from
May 17, 2024

Conversation

mwain
Copy link
Member

@mwain mwain commented May 17, 2024

Groups patching of assets per document to reduce lock contention when concurrently executing mutations.

{
  "mutations": [
    {
      "patch": {
        "id": "a-doc-id",
        "set": {
          "pathA.asset": {
            "_ref": "image-foo-200x200-png",
            "_type": "reference"
          },
          "pathB.asset": {
            "_ref": "image-bar-200x200-png",
            "_type": "reference"
          }
        },
        "setIfMissing": {
          "pathA": {
            "_type": "image"
          },
          "pathB": {
            "_type": "image"
          }
        }
      }
    }
  ]
}

Copy link
Member

@atombender atombender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

src/uploadAssets.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@jonabc jonabc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

src/uploadAssets.js Outdated Show resolved Hide resolved
@ricokahler ricokahler changed the base branch from main to alpha May 17, 2024 15:10
@jonabc jonabc marked this pull request as ready for review May 17, 2024 15:14
@mwain mwain force-pushed the fix/CLDX-2167-assets-per-doc branch from 7061717 to 42d07b7 Compare May 17, 2024 17:04
Groups patching of assets per document to reduce lock contention when concurrently
executing mutations.

```
{
  "mutations": [
    {
      "patch": {
        "id": "a-doc-id",
        "set": {
          "pathA.asset": {
            "_ref": "image-foo-200x200-png",
            "_type": "reference"
          },
          "pathB.asset": {
            "_ref": "image-bar-200x200-png",
            "_type": "reference"
          }
        },
        "setIfMissing": {
          "pathA": {
            "_type": "image"
          },
          "pathB": {
            "_type": "image"
          }
        }
      }
    }
  ]
}
```
@mwain mwain force-pushed the fix/CLDX-2167-assets-per-doc branch from 42d07b7 to a7abfa1 Compare May 17, 2024 17:49
@jonabc jonabc merged commit 1787dd3 into alpha May 17, 2024
3 checks passed
@jonabc jonabc deleted the fix/CLDX-2167-assets-per-doc branch May 17, 2024 18:01
mwain added a commit that referenced this pull request Jun 3, 2024
Groups patching of assets per document to reduce lock contention when concurrently
executing mutations.

```
{
  "mutations": [
    {
      "patch": {
        "id": "a-doc-id",
        "set": {
          "pathA.asset": {
            "_ref": "image-foo-200x200-png",
            "_type": "reference"
          },
          "pathB.asset": {
            "_ref": "image-bar-200x200-png",
            "_type": "reference"
          }
        },
        "setIfMissing": {
          "pathA": {
            "_type": "image"
          },
          "pathB": {
            "_type": "image"
          }
        }
      }
    }
  ]
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants