Merge branch 'main' into enhance/update-dependencies

This commit is contained in:
Lincoln Stein 2023-05-09 23:56:46 -04:00 committed by GitHub
commit 6b6d654f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 11 deletions

View File

@ -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: |

View File

@ -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
*/

View File

@ -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<ServerToClientEvents, ClientToServerEvents> = io(

View File

@ -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<ServerToClientEvents, ClientToServerEvents>;
@ -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
*/

View File

@ -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;
}
}
);