diff --git a/.github/workflows/mkdocs-material.yml b/.github/workflows/mkdocs-material.yml index be665aee54..d6388bce8d 100644 --- a/.github/workflows/mkdocs-material.yml +++ b/.github/workflows/mkdocs-material.yml @@ -2,8 +2,7 @@ name: mkdocs-material on: push: branches: - - 'main' - - 'development' + - 'refs/heads/v2.3' permissions: contents: write @@ -12,6 +11,10 @@ jobs: mkdocs-material: if: github.event.pull_request.draft == false runs-on: ubuntu-latest + env: + REPO_URL: '${{ github.server_url }}/${{ github.repository }}' + REPO_NAME: '${{ github.repository }}' + SITE_URL: 'https://${{ github.repository_owner }}.github.io/InvokeAI' steps: - name: checkout sources uses: actions/checkout@v3 @@ -22,11 +25,15 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' + cache: pip + cache-dependency-path: pyproject.toml - name: install requirements + env: + PIP_USE_PEP517: 1 run: | python -m \ - pip install -r docs/requirements-mkdocs.txt + pip install ".[docs]" - name: confirm buildability run: | diff --git a/invokeai/frontend/web/src/features/system/store/systemSlice.ts b/invokeai/frontend/web/src/features/system/store/systemSlice.ts index 41cb33f88c..a8c8da9bfb 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSlice.ts @@ -384,6 +384,13 @@ export const systemSlice = createSlice({ state.statusTranslationKey = 'common.statusPreparing'; }); + builder.addCase(sessionInvoked.rejected, (state, action) => { + const error = action.payload as string | undefined; + state.toastQueue.push( + makeToast({ title: error || t('toast.serverError'), status: 'error' }) + ); + }); + /** * Session Canceled */ diff --git a/invokeai/frontend/web/src/services/events/middleware.ts b/invokeai/frontend/web/src/services/events/middleware.ts index dab2e756f3..65652ae7ee 100644 --- a/invokeai/frontend/web/src/services/events/middleware.ts +++ b/invokeai/frontend/web/src/services/events/middleware.ts @@ -46,6 +46,8 @@ export const socketMiddleware = () => { // TODO: handle providing jwt to socket.io socketOptions.auth = { token: OpenAPI.TOKEN }; } + + socketOptions.transports = ['websocket', 'polling']; } const socket: Socket = io( diff --git a/invokeai/frontend/web/src/services/events/util/setEventListeners.ts b/invokeai/frontend/web/src/services/events/util/setEventListeners.ts index 89bbc717a3..581363e446 100644 --- a/invokeai/frontend/web/src/services/events/util/setEventListeners.ts +++ b/invokeai/frontend/web/src/services/events/util/setEventListeners.ts @@ -22,6 +22,8 @@ import { } from 'services/thunks/gallery'; import { receivedModels } from 'services/thunks/model'; import { receivedOpenAPISchema } from 'services/thunks/schema'; +import { makeToast } from '../../../features/system/hooks/useToastWatcher'; +import { addToast } from '../../../features/system/store/systemSlice'; type SetEventListenersArg = { socket: Socket; @@ -78,6 +80,16 @@ export const setEventListeners = (arg: SetEventListenersArg) => { } }); + socket.on('connect_error', (error) => { + if (error && error.message) { + dispatch( + addToast( + makeToast({ title: error.message, status: 'error', duration: 10000 }) + ) + ); + } + }); + /** * Disconnect */ diff --git a/invokeai/frontend/web/src/services/thunks/session.ts b/invokeai/frontend/web/src/services/thunks/session.ts index af03045967..6bd7f01c26 100644 --- a/invokeai/frontend/web/src/services/thunks/session.ts +++ b/invokeai/frontend/web/src/services/thunks/session.ts @@ -101,17 +101,24 @@ export const nodeAdded = createAppAsyncThunk( */ export const sessionInvoked = createAppAsyncThunk( 'api/sessionInvoked', - async (arg: { sessionId: string }, _thunkApi) => { + async (arg: { sessionId: string }, { rejectWithValue }) => { const { sessionId } = arg; - const response = await SessionsService.invokeSession({ - sessionId, - all: true, - }); + try { + const response = await SessionsService.invokeSession({ + sessionId, + all: true, + }); + sessionLog.info({ arg, response }, `Session invoked (${sessionId})`); - sessionLog.info({ arg, response }, `Session invoked (${sessionId})`); - - return response; + return response; + } catch (error) { + const err = error as any; + if (err.status === 403) { + return rejectWithValue(err.body.detail); + } + throw error; + } } );