mchades commented on code in PR #12900:
URL: https://github.com/apache/gravitino/pull/12900#discussion_r4290143537
##########
web-v2/web/src/lib/store/metalakes/index.js:
##########
@@ -3041,68 +3270,87 @@ export const appMetalakesSlice = createSlice({
}
})
builder.addCase(fetchModelVersions.rejected, (state, action) => {
- if (!action.error.message.includes('CanceledError')) {
+ if (!action.meta.aborted &&
!action.error.message.includes('CanceledError')) {
toast.error(action.error.message)
}
})
builder.addCase(fetchFunctions.fulfilled, (state, action) => {
state.functions = action.payload.functions
})
- builder.addCase(getFunctionDetails.fulfilled, (state, action) => {
- if (action.payload.init) {
- state.activatedDetails = action.payload.function
- }
- })
builder.addCase(fetchFunctions.rejected, (state, action) => {
- if (!action.error.message.includes('CanceledError')) {
- toast.error(action.error.message)
- }
- })
- builder.addCase(getFunctionDetails.rejected, (state, action) => {
- if (!action.error.message.includes('CanceledError')) {
+ if (!action.meta.aborted &&
!action.error.message.includes('CanceledError')) {
toast.error(action.error.message)
}
})
builder.addCase(fetchViews.fulfilled, (state, action) => {
state.views = action.payload.views
})
builder.addCase(fetchViews.rejected, (state, action) => {
- if (!action.error.message.includes('CanceledError')) {
+ if (!action.meta.aborted &&
!action.error.message.includes('CanceledError')) {
toast.error(action.error.message)
}
})
- builder.addCase(getViewDetails.fulfilled, (state, action) => {
- if (action.payload.init) {
- state.activatedDetails = action.payload.view
+ builder.addCase(deleteView.rejected, (state, action) => {
+ if (!action.meta.aborted &&
!action.error.message.includes('CanceledError')) {
+ toast.error(action.error.message)
+ }
+ })
+ builder.addCase(fetchSemanticModels.pending, (state, action) => {
+ const key = semanticModelSchemaKey(action.meta.arg)
+ trackSemanticModelRequest(state, key, action.meta.requestId, true)
+ if (!state.activeCatalogEntity || state.activeSemanticModelSchema ===
key)
+ state.semanticModelListRequestId = action.meta.requestId
+ })
+ builder.addCase(fetchSemanticModels.fulfilled, (state, action) => {
+ const key = semanticModelSchemaKey(action.meta.arg)
+ const request = state.semanticModelRequests[key]
+ if (!action.payload.stale && request?.requestId ===
action.meta.requestId) {
+ const data = mergeWithSemanticModelNodes({
+ tree: state.metalakeTree,
+ key,
+ entities: action.payload.semanticModels
+ })
+ state.metalakeTree = updateTreeData(state.metalakeTree, key, data)
Review Comment:
[P2] Preserve the full tree load for an unloaded schema
This now inserts Semantic Model children into an unloaded schema
unconditionally. On a fresh direct load of a model URL, the model list can
finish before the tree expands; `TreeComponent.onLoadData` then sees nonempty
children and skips the request that loads tables, views and functions. In
Chrome on `f82d2dd99`, opening `sales_model` shows only the two Semantic Models
under `mart`; its existing `orders` and `customers` tables are missing. The
same direct link/data on `6a368938a` loads all four nodes. Please retain the
loaded-schema guard, or distinguish partial children from a fully loaded schema
so the normal tree fetch still runs. Cover a fresh model deep link with both
table and model siblings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]