-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
SAK-46877 conversations Fix some issues with statistics reporting #13204
base: master
Are you sure you want to change the base?
Conversation
postBean.topic = topicId; | ||
return entityModelForPostBean(conversationsService.savePost(postBean, true)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); |
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.
replace with a log message
@@ -116,7 +116,7 @@ export class SakaiTopic extends reactionsAndUpvotingMixin(SakaiElement) { | |||
this.topic.posts = posts; | |||
|
|||
// We've clicked on a topic and it has no posts. Ergo, it has been "viewed". | |||
if (!this.topic.posts.length) this.topic.viewed = true; | |||
//if (!this.topic?.posts?.length) this.topic.viewed = true; |
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.
Remove comment
getEventStats(ConversationsEvents.REACTED_TO_POST, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = reactedPostCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
getEventStats(ConversationsEvents.POST_VIEWED, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = viewedPostCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
getEventStats(ConversationsEvents.REACTED_TO_TOPIC, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = reactedTopicCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
Map<String, Long> topicCountsByUser = new HashMap<>(); | ||
topicCreatedStats.forEach(stat -> { | ||
getEventStats(ConversationsEvents.TOPIC_CREATED, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = topicCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
getEventStats(ConversationsEvents.TOPIC_UPVOTED, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = upvotedTopicCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
|
||
Map<String, Long> postCountsByUser = new HashMap<>(); | ||
postCreatedStats.forEach(stat -> { | ||
getEventStats(ConversationsEvents.POST_CREATED, siteId, from, to, userIds).forEach(stat -> { | ||
|
||
Long current = postCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
|
||
Long current = reactedCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
Long current = upvotedPostCountsByUser.getOrDefault(stat.getUserId(), 0L); | ||
current = current + stat.getCount(); |
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.
current = current + stat.getCount(); | |
current += stat.getCount(); |
https://sakaiproject.atlassian.net/browse/SAK-46877