Skip to content

Commit 67d6c17

Browse files
committed
Merge branch 'fix/for-v1.9.1' into next
Reviewed-by: Mijeong Park
2 parents 445f7d3 + 5475364 commit 67d6c17

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

app/models/NotificationEvent.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,11 +978,28 @@ private static Set<User> getMandatoryReceivers(Issue issue, EventType eventType)
978978

979979
receivers.removeAll(findUnwatchers(issue.asResource()));
980980
receivers.removeAll(findEventUnwatchersByEventType(issue.project.id, eventType));
981-
receivers.remove(UserApp.currentUser());
981+
receivers.remove(findCurrentUserToBeExcluded(issue.authorId));
982982

983983
return receivers;
984984
}
985985

986+
private static User findCurrentUserToBeExcluded(Long authorId) {
987+
User currentUser;
988+
try {
989+
currentUser = UserApp.currentUser();
990+
} catch (RuntimeException re) {
991+
// expectation: "There is no HTTP Context available from here" runtime exception
992+
currentUser = User.anonymous;
993+
}
994+
995+
if (currentUser.isAnonymous()) {
996+
// It is assumed that it is called by author and processed by system.
997+
return User.find.byId(authorId);
998+
} else {
999+
return currentUser;
1000+
}
1001+
}
1002+
9861003
private static Set<User> getMandatoryReceivers(Posting posting, EventType eventType) {
9871004
Set<User> receivers = findWatchers(posting.asResource());
9881005
receivers.add(posting.getAuthor());
@@ -991,7 +1008,7 @@ private static Set<User> getMandatoryReceivers(Posting posting, EventType eventT
9911008

9921009
receivers.removeAll(findUnwatchers(posting.asResource()));
9931010
receivers.removeAll(findEventUnwatchersByEventType(posting.project.id, eventType));
994-
receivers.remove(UserApp.currentUser());
1011+
receivers.remove(findCurrentUserToBeExcluded(posting.authorId));
9951012

9961013
return receivers;
9971014
}
@@ -1006,7 +1023,7 @@ private static Set<User> getMandatoryReceivers(Comment comment, EventType eventT
10061023

10071024
receivers.removeAll(findUnwatchers(parent.asResource()));
10081025
receivers.removeAll(findEventUnwatchersByEventType(comment.projectId, eventType));
1009-
receivers.remove(UserApp.currentUser());
1026+
receivers.remove(findCurrentUserToBeExcluded(comment.authorId));
10101027

10111028
return receivers;
10121029
}
@@ -1042,7 +1059,7 @@ private static Set<User> extractMembers(Project project) {
10421059
private static Set<User> getReceiversForIssueBodyChanged(String oldBody, Issue issue) {
10431060
Set<User> receivers = getMandatoryReceivers(issue, ISSUE_BODY_CHANGED);
10441061
receivers.addAll(getNewMentionedUsers(oldBody, issue.body));
1045-
receivers.remove(UserApp.currentUser());
1062+
receivers.remove(findCurrentUserToBeExcluded(issue.authorId));
10461063
return receivers;
10471064
}
10481065

app/models/Project.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public Set<User> findAuthorsAndWatchers() {
191191
}
192192

193193
private Set<User> getIssueUsers() {
194-
String issueSql = "SELECT distinct author_id id FROM ISSUE where project_id=" + this.id;
194+
String issueSql = "select distinct author_id id from issue where project_id=" + this.id;
195195
return User.find.setRawSql(RawSqlBuilder.parse(issueSql).create()).findSet();
196196
}
197197

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import java.nio.file.Paths
33

44
name := """yona"""
55

6-
version := "1.9.0"
6+
version := "1.9.1"
77

88
libraryDependencies ++= Seq(
99
// Add your project dependencies here,

public/javascripts/lib/atjs/jquery.atwho.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@
272272
};
273273

274274
App.prototype.dispatch = function(e) {
275+
if (e === undefined) {
276+
return;
277+
}
275278
var _, c, ref, results;
276279
ref = this.controllers;
277280
results = [];

0 commit comments

Comments
 (0)