Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/unit/sync-accumulator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1101,13 +1101,13 @@
);
expect(sa.getJSON().roomsData[Category.Join]["!foo:bar"].msc4354_sticky?.events).toEqual([ev]);
});
it("should clear stale sticky events", () => {
it.only("should clear stale sticky events", () => {

Check failure on line 1104 in spec/unit/sync-accumulator.spec.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected focused test
jest.setSystemTime(1000);
const ev = stickyEvent(1000);
sa.accumulate(
syncSkeleton({
msc4354_sticky: {
events: [ev, stickyEvent(0)],
events: [ev],
},
}),
);
Expand Down
2 changes: 1 addition & 1 deletion src/sync-accumulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ export class SyncAccumulator {
// Prune out any events in our stores that have since expired, do this before we
// insert new events.
currentData._stickyEvents = currentData._stickyEvents.filter((ev) => {
return Date.now() < ev.msc4354_sticky.duration_ms + ev.origin_server_ts;
return Date.now() > ev.msc4354_sticky.duration_ms + ev.origin_server_ts;
});

// We want this to be fast, so don't worry about duplicate events here. The RoomStickyEventsStore will
Expand Down
Loading