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

Add removeIfNotAttached to client.detach() options #703

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

chacha912
Copy link
Contributor

What this PR does / why we need it?

Add removeIfNotAttached to client.detach() option
(Ref: Go-SDK yorkie-team/yorkie#560)

Does this PR introduce a user-facing change?:

When the removeIfNotAttached option is set during detaching, the document will be removed after detaching only if there are no other clients simultaneously editing the document (i.e., no clients are currently attached). The default setting for removeIfNotAttached is false.

await client.detach(doc, { removeIfNotAttached: true });

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41f5b2f) 69.11% compared to head (5f5ee3e) 69.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #703      +/-   ##
==========================================
+ Coverage   69.11%   69.13%   +0.01%     
==========================================
  Files          58       58              
  Lines        8787     8789       +2     
  Branches      800      802       +2     
==========================================
+ Hits         6073     6076       +3     
+ Misses       2454     2453       -1     
  Partials      260      260              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chacha912
Copy link
Contributor Author

CC) @humdrum , @7hong13

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@hackerwins hackerwins changed the title Add removeIfNotAttached to client.detach() option Add removeIfNotAttached to client.detach() options Dec 1, 2023
@hackerwins hackerwins merged commit d0f5aed into main Dec 1, 2023
1 check passed
@hackerwins hackerwins deleted the remove-if-not-attached branch December 1, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants