Skip to content

Commit

Permalink
Check if the latest event is a BatchInformationFetchingEvent for getD…
Browse files Browse the repository at this point in the history
…atasetHasBatchInformation()

This allows a BatchInformationMissingEvent to take precedence.
  • Loading branch information
arteymix committed Jun 20, 2024
1 parent 92ea729 commit aefcca2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
import ubic.gemma.core.search.SearchResult;
import ubic.gemma.core.search.lucene.SimpleMarkdownFormatter;
import ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysisValueObject;
import ubic.gemma.model.common.auditAndSecurity.AuditEvent;
import ubic.gemma.model.common.auditAndSecurity.eventType.BatchInformationEvent;
import ubic.gemma.model.common.auditAndSecurity.eventType.BatchInformationFetchingEvent;
import ubic.gemma.model.common.description.AnnotationValueObject;
import ubic.gemma.model.common.description.Characteristic;
Expand Down Expand Up @@ -909,7 +911,10 @@ public ResponseDataObject<Boolean> getDatasetHasBatchInformation( // Params:
@PathParam("dataset") DatasetArg<?> datasetArg // Required
) {
ExpressionExperiment ee = datasetArgService.getEntity( datasetArg );
return respond( this.auditEventService.hasEvent( ee, BatchInformationFetchingEvent.class ) );
// BatchInformationEvent can either be BatchInformationFetchingEvent or BatchInformationMissingEvent, we
// consider the class of the latest one
AuditEvent event = this.auditEventService.getLastEvent( ee, BatchInformationEvent.class );
return respond( event != null && event.getEventType() instanceof BatchInformationFetchingEvent );
}

/**
Expand Down

0 comments on commit aefcca2

Please sign in to comment.