-
Notifications
You must be signed in to change notification settings - Fork 258
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
test(event cache): rely less on EventCache::add_initial_events()
#4372
Conversation
And make it a smoke test that the event cache correctly gets events it retrieves from sync.
…nd event cache storage
…_initial_items` Moar MatrixMockServer \o/
… storage has been enabled Not worth testing IMO, since this is about the "temporary" API we're going to remove in subsequent patches.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4372 +/- ##
=======================================
Coverage 85.14% 85.14%
=======================================
Files 280 280
Lines 30764 30766 +2
=======================================
+ Hits 26195 26197 +2
Misses 4569 4569 ☔ View full report in Codecov by Sentry. |
Update::NewItemsChunk { previous: None, new: ChunkIdentifier::new(0), next: None }, | ||
Update::PushItems { | ||
at: Position::new(ChunkIdentifier::new(0), 0), | ||
items: vec![ | ||
f.text_msg("hey there").sender(dexter).into_sync(), | ||
f.text_msg("hoy!").sender(ivan).into_sync(), | ||
], | ||
}, |
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.
I wonder if we shouldn't use a builder for that 🤔, thoughts?
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.
I think we could even avoid that by using a sync, and let the event cache store the events in memory.
e8a4ce0
to
bdda880
Compare
EventCache::add_initial_events()
was supposed to be temporary, until the event cache has its own storage. It's been used in multiple tests, as a way to prefill the event cache. It's used in other place, when constructing a timeline, to prefill the room event cache with the (soon-to-be-deprecated) cached timeline we stored in the sliding sync storage (akatimeline_queue()
).This patch gets rids of all uses in tests, so that there remains only a single use (when creating the timeline). We can later remove this function, once the storage has been enabled unconditionally.
Part of #3280
Split from #4308.