Skip to content

Commit

Permalink
Publishing State Change Bug ??
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Nov 15, 2023
1 parent 42e04f2 commit 6851328
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,11 @@ private synchronized void setWork(
this.errorHandler = errorHandler;
this.successHandler = successHandler;

setState(ExportNotification.State.PENDING);
if (state != ExportNotification.State.PUBLISHING) {
setState(ExportNotification.State.PENDING);
} else if (dependentCount > 0) {
throw new IllegalStateException("published exports cannot have dependencies");
}
if (dependentCount <= 0) {
dependentCount = 0;
scheduleExport();
Expand Down Expand Up @@ -945,7 +949,7 @@ private void onResolveOne(@Nullable final ExportObject<?> parent) {
*/
private void scheduleExport() {
synchronized (this) {
if (state != ExportNotification.State.PENDING) {
if (state != ExportNotification.State.PENDING && state != ExportNotification.State.PUBLISHING) {
return;
}
setState(ExportNotification.State.QUEUED);
Expand Down

0 comments on commit 6851328

Please sign in to comment.