-
Notifications
You must be signed in to change notification settings - Fork 268
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
feat(common): Implement LinkedChunk::clear
#4317
Conversation
3497c7e
to
848451f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4317 +/- ##
==========================================
- Coverage 85.10% 85.06% -0.04%
==========================================
Files 274 274
Lines 30203 30213 +10
==========================================
- Hits 25703 25700 -3
- Misses 4500 4513 +13 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Do you also want to have RoomEvents::reset
make use of this function in this PR, or in a different one? (it would require a new test that when subscribing to updates_as_vec of the underlying linked chunk, the subscription stream doesn't shut down when RoomEvents::reset()
is called)
It's purposely on another PR, not yet submitted to avoid PR stacking :-). |
848451f
to
31fc3b3
Compare
This patch implements `LinkedChunk::clear`. The code from `impl Drop for LinkedChunk` has been moved inside `Ends::clear`, and replaced by a simple `self.links.clear()`. In addition, `LinkedChunk::clear` indeed calls `self.links.clear()` but also resets all fields. This patch adds the `Clear` variant to `Update`. This patch updates `AsVector` to emit a `VectorDiff::Clear` on `Update::Clear`. Finally, this patch adds the necessary tests.
31fc3b3
to
84a8355
Compare
This patch implements
LinkedChunk::clear
. The code fromimpl Drop for LinkedChunk
has been moved insideEnds::clear
, and replaced by a simpleself.links.clear()
. In addition,LinkedChunk::clear
indeed callsself.links.clear()
but also resets all fields.This patch adds the
Clear
variant toUpdate
.This patch updates
AsVector
to emit aVectorDiff::Clear
onUpdate::Clear
.Finally, this patch adds the necessary tests.
EventCache
storage #3280