Skip to content
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

[7.x] [maps] abort sync data if any data request fails (#87381) #87902

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,11 @@ export class VectorLayer extends AbstractLayer {
join,
propertiesMap,
};
} catch (e) {
if (!(e instanceof DataRequestAbortError)) {
onLoadError(sourceDataId, requestToken, `Join error: ${e.message}`);
} catch (error) {
if (!(error instanceof DataRequestAbortError)) {
onLoadError(sourceDataId, requestToken, `Join error: ${error.message}`);
}
return {
dataHasChanged: true,
join,
};
throw error;
}
}

Expand Down Expand Up @@ -430,7 +427,7 @@ export class VectorLayer extends AbstractLayer {
};
}

async _performInnerJoins(
_performInnerJoins(
sourceResult: SourceResult,
joinStates: JoinState[],
updateSourceData: DataRequestContext['updateSourceData']
Expand Down Expand Up @@ -538,9 +535,7 @@ export class VectorLayer extends AbstractLayer {
if (!(error instanceof DataRequestAbortError)) {
onLoadError(dataRequestId, requestToken, error.message);
}
return {
refreshed: false,
};
throw error;
}
}

Expand Down Expand Up @@ -646,6 +641,7 @@ export class VectorLayer extends AbstractLayer {
if (!(error instanceof DataRequestAbortError)) {
onLoadError(dataRequestId, requestToken, error.message);
}
throw error;
}
}

Expand Down Expand Up @@ -736,6 +732,7 @@ export class VectorLayer extends AbstractLayer {
stopLoading(dataRequestId, requestToken, formatters, nextMeta);
} catch (error) {
onLoadError(dataRequestId, requestToken, error.message);
throw error;
}
}

Expand All @@ -757,19 +754,26 @@ export class VectorLayer extends AbstractLayer {
if (this.isLoadingBounds()) {
return;
}
await this._syncSourceStyleMeta(syncContext, source, style);
await this._syncSourceFormatters(syncContext, source, style);
const sourceResult = await this._syncSource(syncContext, source, style);
if (
!sourceResult.featureCollection ||
!sourceResult.featureCollection.features.length ||
!this.hasJoins()
) {
return;
}

const joinStates = await this._syncJoins(syncContext, style);
await this._performInnerJoins(sourceResult, joinStates, syncContext.updateSourceData);
try {
await this._syncSourceStyleMeta(syncContext, source, style);
await this._syncSourceFormatters(syncContext, source, style);
const sourceResult = await this._syncSource(syncContext, source, style);
if (
!sourceResult.featureCollection ||
!sourceResult.featureCollection.features.length ||
!this.hasJoins()
) {
return;
}

const joinStates = await this._syncJoins(syncContext, style);
this._performInnerJoins(sourceResult, joinStates, syncContext.updateSourceData);
} catch (error) {
if (!(error instanceof DataRequestAbortError)) {
throw error;
}
}
}

_getSourceFeatureCollection() {
Expand Down