feat: tag events handlers partial recovery#792
Open
aintnostressin wants to merge 1 commit intomainfrom
Open
Conversation
ok300
reviewed
Apr 3, 2026
Comment on lines
+274
to
+277
| let tagger_in_index = | ||
| TagUser::check_set_member(&[tagged_id.as_str(), label.as_str()], &user_id) | ||
| .await? | ||
| .1; |
Contributor
There was a problem hiding this comment.
Suggested change
| let tagger_in_index = | |
| TagUser::check_set_member(&[tagged_id.as_str(), label.as_str()], &user_id) | |
| .await? | |
| .1; | |
| let (_, tagger_in_index) = | |
| TagUser::check_set_member(&[&tagged_id, &label], &user_id).await?; |
Comment on lines
+282
to
+287
| let tagger_in_index = TagPost::check_set_member( | ||
| &[author_id.as_str(), post_id.as_str(), label.as_str()], | ||
| &user_id, | ||
| ) | ||
| .await? | ||
| .1; |
Contributor
There was a problem hiding this comment.
Suggested change
| let tagger_in_index = TagPost::check_set_member( | |
| &[author_id.as_str(), post_id.as_str(), label.as_str()], | |
| &user_id, | |
| ) | |
| .await? | |
| .1; | |
| let (_, tagger_in_index) = | |
| TagPost::check_set_member(&[&author_id, &post_id, &label], &user_id).await?; |
|
|
||
| // Read the target details for a tag without deleting the TAGGED edge. | ||
| // Used in tag del to read before graph-last deletion. | ||
| pub fn get_tag_target(user_id: &str, tag_id: &str) -> Query { |
Contributor
There was a problem hiding this comment.
This is almost identical (1 line diff) to delete_tag in del.rs. This means any future logic change in the query has to reflect equally across both methods.
Maybe there's a way to avoid query duplication? Like have both methods internally use the same "query builder fn" with one boolean flag include_delete_call?
Alternatively, both methods should have a comment pointing at each other, saying "query logic must be kept in-sync with (other fn)". Although this is more error prone than the 1st suggestion.
| let user_id: Option<String> = row.get("user_id").unwrap_or(None); | ||
| let author_id: Option<String> = row.get("author_id").unwrap_or(None); | ||
| let post_id: Option<String> = row.get("post_id").unwrap_or(None); | ||
| let label: String = row.get("label").expect("Query should return tag label"); |
Contributor
There was a problem hiding this comment.
Maybe this shouldn't panic, but instead throw a GraphError?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares tag handlers for partial recovery.