···
26
26
27
27
async addActivity(activity: FeedActivity): Promise<Result<void>> {
28
28
try {
29
29
-
console.log('InMemoryFeedRepository: Adding activity', activity);
30
29
this.activities.push(activity);
31
31
-
console.log('Total Activities:', this.activities.length);
32
30
// Sort by creation time descending
33
31
this.activities.sort(
34
32
(a, b) => b.createdAt.getTime() - a.createdAt.getTime(),
35
33
);
36
36
-
console.log('Activities after addition:', this.activities);
37
34
return ok(undefined);
38
35
} catch (error) {
39
36
return err(error as Error);
···
44
41
options: FeedQueryOptions,
45
42
): Promise<Result<PaginatedFeedResult>> {
46
43
try {
47
47
-
console.log(
48
48
-
'InMemoryFeedRepository: Getting global feed with options',
49
49
-
options,
50
50
-
);
51
51
-
console.log('Total Activities:', this.activities.length);
52
44
const { page, limit, beforeActivityId } = options;
53
45
let filteredActivities = [...this.activities];
54
46