Skip to content

Fix: Update document tool to generate a new id after update #943

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

razertory
Copy link

Issue:

This project's artifact will have an editing feature, but the newly edited results will overwrite historical artifacts. For example, when Python code V1 is output and I prompt a modification to produce V2, clicking on V1's code displays V2 instead. This differs from projects like v0.dev, which allow viewing rendered content of different artifact versions.

Furthermore, I discovered that the primary key in the Document table of the database is not unique. In the earlier example, querying the database reveals two records with identical IDs—a result that is often confusing and meaningless.

image

Solution:

At the onUpdate stage, generate a new UUID and save it as a new version.

Copy link

vercel bot commented Apr 21, 2025

@razertory is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant