keystone icon indicating copy to clipboard operation
keystone copied to clipboard

add ability to always include field in update

Open rburgst opened this issue 3 years ago • 7 comments

  • this serves as the basis for optimistic locking
  • you can now configure a version field as readonly and have it included in all update calls
  • on the server side you can then validate the version with the item.version and then throw a validation error in case it does not match
  • that way a concurrent modification on the server can be identified

fixes #6851

rburgst avatar Nov 26 '21 07:11 rburgst

🦋 Changeset detected

Latest commit: 4d34ff2367a44d86789a0fc3ce4f0d6766a1e7c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@keystone-6/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Nov 26 '21 07:11 changeset-bot[bot]

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/4CM6cAQ2vuQ5eyeLXtEFT333va4w
✅ Preview: https://keystone-next-docs-git-fork-rburgst-feature-a-be6ca9-keystonejs.vercel.app

vercel[bot] avatar Nov 26 '21 07:11 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4d34ff2367a44d86789a0fc3ce4f0d6766a1e7c5:

Sandbox Source
@keystone-6/sandbox Configuration

codesandbox-ci[bot] avatar Nov 26 '21 07:11 codesandbox-ci[bot]

What do I need to do to get this change reviewed?

rburgst avatar Nov 30 '21 21:11 rburgst

anyone home?

rburgst avatar Feb 13 '22 07:02 rburgst

Hi @rburgst,

Sorry for the extended delay, I hope to look into this this week, if any changes are required I'll update this pull request or the related discussion.

Thanks for your patience :pray:

dcousens avatar Mar 01 '22 00:03 dcousens

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
keystone-next-docs ✅ Ready (Inspect) Visit Preview Oct 23, 2022 at 5:49AM (UTC)

vercel[bot] avatar Aug 15 '22 04:08 vercel[bot]

I have rebased it on to main, @dcousens any chance to get this reviewed?

rburgst avatar Oct 23 '22 05:10 rburgst

@rburgst this has been re-added to the priority list for the next release. Thanks for the rebase! I'll keep this thread updated with any changes. I'll try and make a label so we can indicate that status in future :label::blue_heart:

dcousens avatar Oct 23 '22 06:10 dcousens

I believe the use case would be more complete along with prisma 4.5.0 with extendWhereUnique preview feature. hopefully team will consider using this preview feature.

gautamsi avatar Oct 23 '22 15:10 gautamsi

@gautamsi that would obviously be even better. Then however, I guess keystone would need to have a built-in version field which would then utilize this new feature. With my patch you can get "ok-ish" close with your own field implementation.

rburgst avatar Oct 26 '22 06:10 rburgst

Replaced by https://github.com/keystonejs/keystone/pull/8283

dcousens avatar Jan 31 '23 04:01 dcousens