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

Repost with deletions/edits v1 #3687

Closed
wants to merge 7 commits into from
Closed

Conversation

moodyjon
Copy link
Contributor

Context: lbryio/types#49

Definitely very rough, with only a few attributes tested. Just putting this out there as an object for discussion.

The issue I'm currently wrestling with is how to treat common fields like tags, languages, title, description. When an update() request to set (or clear) such a field comes from jsonrpc_stream_update(), do I put it in BaseClaim, or ClaimReference? I am trying to set these first in the Repost(BaseClaim), then for the ones that fail, I try to put them in ClaimReference (either deletions or edits).

Maybe there should be separate args or a mode flag at the level of jsonrpc_stream_update that selects where to apply the modifications? Regular mode would modify the Repost. Embedded mode would modify the ClaimReference (deletions/edits).

I could also do something like split the updates into deletions and edits first. For deletions, try the BaseClaim (of the Repost) first, then fallback to ClaimReference. For edits, try the ClaimReference first, then fallback to BaseClaim (of the Repost).

Protobuf changes:

diff --git a/v2/proto/claim.proto b/v2/proto/claim.proto
index cccb960..7008578 100644
--- a/v2/proto/claim.proto
+++ b/v2/proto/claim.proto
@@ -42,6 +42,8 @@ message Channel {
 
 message ClaimReference {
     bytes claim_hash = 1;
+    Claim deletions = 2;
+    Claim edits = 3;
 }

@@ -23,4 +23,4 @@ idea:
cp -r scripts/idea/* .idea

elastic-docker:
docker run -d -v lbryhub:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e"ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
docker run -d --env network.publish_host=127.0.0.1 -v lbryhub:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e"ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I seem to have to use this to get "make elastic-docker" to work. Is it just me? (MacOS aarch64)

Comment on lines +423 to +430
def update(self, **kwargs) -> dict:
claim_type = kwargs.pop('claim_type', None)
# Update common fields within BaseClaim.
kwargs = super().update(strict_update=False, **kwargs)
if claim_type:
# Remaining updates go into deletes/edits of ClaimReference.
kwargs = self.reference.update(claim_type, **kwargs)
return kwargs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See PR description. This is where I have a choice of applying the update to BaseClaim or stuff it inside ClaimReference.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 55.922% when pulling 5fb7703 on moodyjon:repost_modify into d0aad8c on lbryio:master.

@moodyjon moodyjon changed the title Repost with deletions/edits Repost with deletions/edits v1 Oct 24, 2022
@lyoshenka lyoshenka removed their request for review November 3, 2022 20:38
@lyoshenka
Copy link
Member

gonna hold off on reviewing this for now. we discussed how edit/deletions are a bigger project that we need to tackle now, and we'll think about them again once the extensions work is done and we see how it plays in the wild

@moodyjon
Copy link
Contributor Author

Closed in favor of #3706

@moodyjon moodyjon closed this Nov 10, 2022
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.

4 participants