Merge pull request #10734 from Budibase/disable-websocket-http-polling
Disable websocket HTTP polling
This commit is contained in:
commit
f4a988de37
|
@ -24,7 +24,7 @@ export const createBuilderWebsocket = () => {
|
||||||
tables.replaceTable(id, table)
|
tables.replaceTable(id, table)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Table events
|
// Datasource events
|
||||||
socket.on("datasource-change", ({ id, datasource }) => {
|
socket.on("datasource-change", ({ id, datasource }) => {
|
||||||
datasources.replaceDatasource(id, datasource)
|
datasources.replaceDatasource(id, datasource)
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
import { Heading, Body, Button, Icon } from "@budibase/bbui"
|
import { Heading, Body, Button, Icon } from "@budibase/bbui"
|
||||||
import { processStringSync } from "@budibase/string-templates"
|
import { processStringSync } from "@budibase/string-templates"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
import { helpers } from "@budibase/shared-core"
|
|
||||||
import { UserAvatar } from "@budibase/frontend-core"
|
import { UserAvatar } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export let app
|
export let app
|
||||||
export let lockedAction
|
export let lockedAction
|
||||||
|
|
||||||
$: editing = app?.lockedBy != null
|
$: editing = app?.lockedBy != null
|
||||||
$: initials = helpers.getUserInitials(app?.lockedBy)
|
|
||||||
|
|
||||||
const handleDefaultClick = () => {
|
const handleDefaultClick = () => {
|
||||||
if (window.innerWidth < 640) {
|
if (window.innerWidth < 640) {
|
||||||
|
|
|
@ -355,7 +355,6 @@
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
gap: var(--spacing-xl);
|
gap: var(--spacing-xl);
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-wrapper {
|
.empty-wrapper {
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
"sanitize-html": "^2.7.0",
|
"sanitize-html": "^2.7.0",
|
||||||
"screenfull": "^6.0.1",
|
"screenfull": "^6.0.1",
|
||||||
"shortid": "^2.2.15",
|
"shortid": "^2.2.15",
|
||||||
"socket.io-client": "^4.5.1",
|
|
||||||
"svelte": "^3.49.0",
|
"svelte": "^3.49.0",
|
||||||
"svelte-apexcharts": "^1.0.2",
|
"svelte-apexcharts": "^1.0.2",
|
||||||
"svelte-flatpickr": "^3.1.0",
|
"svelte-flatpickr": "^3.1.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
notificationStore,
|
notificationStore,
|
||||||
} from "./stores/index.js"
|
} from "./stores/index.js"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { io } from "socket.io-client"
|
import { createWebsocket } from "@budibase/frontend-core"
|
||||||
|
|
||||||
let socket
|
let socket
|
||||||
|
|
||||||
|
@ -18,20 +18,7 @@ export const initWebsocket = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise connection
|
// Initialise connection
|
||||||
const tls = location.protocol === "https:"
|
socket = createWebsocket("/socket/client")
|
||||||
const proto = tls ? "wss:" : "ws:"
|
|
||||||
const host = location.hostname
|
|
||||||
const port = location.port || (tls ? 443 : 80)
|
|
||||||
socket = io(`${proto}//${host}:${port}`, {
|
|
||||||
path: "/socket/client",
|
|
||||||
// Cap reconnection attempts to 3 (total of 15 seconds before giving up)
|
|
||||||
reconnectionAttempts: 3,
|
|
||||||
// Delay reconnection attempt by 5 seconds
|
|
||||||
reconnectionDelay: 5000,
|
|
||||||
reconnectionDelayMax: 5000,
|
|
||||||
// Timeout after 4 seconds so we never stack requests
|
|
||||||
timeout: 4000,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
socket.on("plugin-update", data => {
|
socket.on("plugin-update", data => {
|
||||||
|
|
|
@ -19,5 +19,8 @@ export const createWebsocket = path => {
|
||||||
reconnectionDelayMax: 5000,
|
reconnectionDelayMax: 5000,
|
||||||
// Timeout after 4 seconds so we never stack requests
|
// Timeout after 4 seconds so we never stack requests
|
||||||
timeout: 4000,
|
timeout: 4000,
|
||||||
|
// Disable polling and rely on websocket only, as HTTP transport
|
||||||
|
// will only work with sticky sessions which we don't have
|
||||||
|
transports: ["websocket"]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -22932,7 +22932,7 @@ socket.io-adapter@~2.5.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
ws "~8.11.0"
|
ws "~8.11.0"
|
||||||
|
|
||||||
socket.io-client@^4.5.1, socket.io-client@^4.6.1:
|
socket.io-client@^4.6.1:
|
||||||
version "4.6.1"
|
version "4.6.1"
|
||||||
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.6.1.tgz#80d97d5eb0feca448a0fb6d69a7b222d3d547eab"
|
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.6.1.tgz#80d97d5eb0feca448a0fb6d69a7b222d3d547eab"
|
||||||
integrity sha512-5UswCV6hpaRsNg5kkEHVcbBIXEYoVbMQaHJBXJCyEQ+CiFPV1NIOY0XOFWG4XR4GZcB8Kn6AsRs/9cy9TbqVMQ==
|
integrity sha512-5UswCV6hpaRsNg5kkEHVcbBIXEYoVbMQaHJBXJCyEQ+CiFPV1NIOY0XOFWG4XR4GZcB8Kn6AsRs/9cy9TbqVMQ==
|
||||||
|
|
Loading…
Reference in New Issue