From 472e6e07b5ef39d7cd6c847f71462dbbc4fc42db Mon Sep 17 00:00:00 2001 From: Bob Bobs Date: Wed, 28 Feb 2024 15:11:32 -0700 Subject: [PATCH 1/4] fix: only delete session if error is Unauthorized --- src/controllers/client/ClientController.tsx | 2 +- src/controllers/client/jsx/error.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/client/ClientController.tsx b/src/controllers/client/ClientController.tsx index 72646f54..5271df73 100644 --- a/src/controllers/client/ClientController.tsx +++ b/src/controllers/client/ClientController.tsx @@ -159,7 +159,7 @@ class ClientController { }) .catch((err) => { const error = takeError(err); - if (error === "Forbidden" || error === "Unauthorized") { + if (error === "Unauthorized") { this.sessions.delete(user_id); this.current = null; this.pickNextSession(); diff --git a/src/controllers/client/jsx/error.tsx b/src/controllers/client/jsx/error.tsx index c171c55a..144b0fd9 100644 --- a/src/controllers/client/jsx/error.tsx +++ b/src/controllers/client/jsx/error.tsx @@ -10,8 +10,9 @@ export function takeError(error: any): string { case 429: return "TooManyRequests"; case 401: + return "Unauthorized" case 403: - return "Unauthorized"; + return "Forbidden"; default: return "UnknownError"; } From 60fdb5c091e118e92bb0141231a59cfae3394418 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Wed, 13 Mar 2024 23:41:54 +0000 Subject: [PATCH 2/4] docs: legacy release procedure --- README.md | 25 +++++++++++++++++++++++++ scripts/publish.sh | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d9c4c9d..d79213a0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ +# Deprecation Notice + +This project is deprecated, however it still may receive maintenance updates. + +PRs for small fixes are more than welcome. + +## Deploying a new release + +```bash +cd ~/deployments/revite +git pull +git submodule update + +# check: +git status + +export REVOLT_SAAS_BRANCH=revite/main +export REMOTE=root@production +scripts/publish.sh + +# SSH in and restart revite: +ssh $REMOTE +tmux a -t 4 +``` + # Revite ## Description diff --git a/scripts/publish.sh b/scripts/publish.sh index e7e9b344..24e9e3e4 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -11,7 +11,7 @@ fi REMOTE_DIR=/root/deployments/revite # Post-install script -POST_INSTALL="pm2 restart revite" +POST_INSTALL="" # Assets export REVOLT_SAAS=https://github.com/revoltchat/assets From c25ecc12b2639b984680cbf2a5bf2c2a978fd489 Mon Sep 17 00:00:00 2001 From: Sophie L Date: Wed, 13 Mar 2024 23:18:56 +0000 Subject: [PATCH 3/4] chore: rm mirroring script --- .github/workflows/mirroring.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/mirroring.yml diff --git a/.github/workflows/mirroring.yml b/.github/workflows/mirroring.yml deleted file mode 100644 index 8a2cfdc1..00000000 --- a/.github/workflows/mirroring.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Mirroring - -on: - push: - branches: - - "master" - -jobs: - to_gitlab: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v1 - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: git@gitlab.com:insert/revolt-vite.git - ssh_private_key: ${{ secrets.GITLAB_SSH_PRIVATE_KEY }} From 5b6546b761568e1b5a1a6092550ab7e68bc80647 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Fri, 15 Mar 2024 19:50:17 +0000 Subject: [PATCH 4/4] fix: allow retrying sending files --- README.md | 2 ++ src/components/common/messaging/MessageBox.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d79213a0..1261a634 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ PRs for small fixes are more than welcome. ## Deploying a new release +Ensure `.env.local` points to `https://app.revolt.chat/api`. + ```bash cd ~/deployments/revite git pull diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 69b425be..78c26981 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -324,7 +324,7 @@ export default observer(({ channel }: Props) => { return; const content = state.draft.get(channel._id)?.content?.trim() ?? ""; - if (uploadState.type === "attached") return sendFile(content); + if (uploadState.type !== "none") return sendFile(content); if (content.length === 0) return; internalEmit("NewMessages", "hide"); @@ -406,7 +406,9 @@ export default observer(({ channel }: Props) => { * @returns */ async function sendFile(content: string) { - if (uploadState.type !== "attached") return; + if (uploadState.type !== "attached" && uploadState.type !== "failed") + return; + const attachments: string[] = []; setMessage;