Skip to content

Commit d80fdd3

Browse files
committed
Merge remote-tracking branch 'origin/dev-1.2' into development
2 parents 3dd3c51 + 0322d03 commit d80fdd3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/main/java/ch/ethz/seb/sps/server/datalayer/dao/impl/ScreenshotDataLiveCacheDAOBatis.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ private Long getLastScreenshotEntryId(String sessionUUID) {
161161
.build()
162162
.execute();
163163

164-
if (all != null) {
164+
if (all != null && !all.isEmpty()) {
165165
return all.get(all.size() - 1);
166166
}
167167

168-
log.warn("No screenshot entry found for session: {}", sessionUUID);
168+
log.info("No screenshot entry found for session: {}", sessionUUID);
169169
return null;
170170
} catch (Exception e) {
171171
log.error("Failed to get last screenshot entry for session: {} error: {}", sessionUUID, e.getMessage());

src/main/java/ch/ethz/seb/sps/server/datalayer/dao/impl/SessionDAOBatis.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ private void deleteSessionScreenshots(final SessionRecord sessionRecord) {
554554
.build()
555555
.execute();
556556

557+
557558
// then all screenshots
558559
this.screenshotDAO
559560
.deleteAllForSession(sessionRecord.getUuid(), screenShotPKs)
@@ -734,17 +735,15 @@ public Result<Boolean> hasAnySessionData(Collection<Long> groupIds) {
734735
.build()
735736
.execute();
736737

737-
if (sessionIds == null || sessionIds.isEmpty()) {
738-
return false;
739-
}
740-
741-
Long dataNum = this.screenshotDataRecordMapper
742-
.countByExample()
743-
.where(ScreenshotDataRecordDynamicSqlSupport.id, isIn(sessionIds))
744-
.build()
745-
.execute();
738+
return sessionIds != null && !sessionIds.isEmpty();
746739

747-
return dataNum != null && dataNum.intValue() != 0;
740+
// Long dataNum = this.screenshotDataRecordMapper
741+
// .countByExample()
742+
// .where(ScreenshotDataRecordDynamicSqlSupport.id, isIn(sessionIds))
743+
// .build()
744+
// .execute();
745+
//
746+
// return dataNum != null && dataNum.intValue() != 0;
748747
});
749748
}
750749

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminExamController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public Exam create(
101101
produces = MediaType.APPLICATION_JSON_VALUE)
102102

103103
public Collection<EntityKey> requestDelete(@PathVariable final String modelId) {
104+
// TODO this should never block here do this in background with balk action
104105
if (!this.sessionService.hasAnySessionDataForExam(modelId)) {
105106
return super.hardDelete(modelId);
106107
} else {

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminGroupController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public Group create(
125125
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
126126
produces = MediaType.APPLICATION_JSON_VALUE)
127127
public Collection<EntityKey> requestDelete(@PathVariable(name = API.PARAM_MODEL_ID) final String groupUUID) {
128-
128+
// TODO this should never block here do this in background with balk action
129129
if (!this.sessionService.hasAnySessionDataForGroup(groupUUID)) {
130130
return super.hardDelete(groupUUID);
131131
} else {

0 commit comments

Comments
 (0)