diff --git a/api/routers/core.py b/api/routers/core.py index 9af9fec63..59bede0ae 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -36,8 +36,7 @@ def get_session2(projectId: int, sessionId: Union[int, str], context: schemas.Cu include_fav_viewed=True, group_metadata=True) if data is None: return {"errors": ["session not found"]} - if not data.get("live"): - sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId) + sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId) return { 'data': data } diff --git a/backend/pkg/db/postgres/connector.go b/backend/pkg/db/postgres/connector.go index 9e4e82633..1eb29e04c 100644 --- a/backend/pkg/db/postgres/connector.go +++ b/backend/pkg/db/postgres/connector.go @@ -10,7 +10,7 @@ import ( ) func getTimeoutContext() context.Context { - ctx, _ := context.WithTimeout(context.Background(), time.Duration(time.Second*10)) + ctx, _ := context.WithTimeout(context.Background(), time.Duration(time.Second*30)) return ctx } diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index c8c1c7669..9ca77c1ea 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -156,7 +156,7 @@ def update(tenant_id, user_id, changes): (SELECT role_id FROM roles WHERE tenant_id = %(tenant_id)s AND name != 'Owner' LIMIT 1)))""") else: sub_query_users.append(f"{helper.key_to_snake_case(key)} = %({key})s") - + changes["role_id"] = changes.get("roleId", changes.get("role_id")) with pg_client.PostgresClient() as cur: if len(sub_query_users) > 0: cur.execute( diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 86f07c4f6..782f47e74 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -21,6 +21,10 @@ import Header from 'Components/Header/Header'; import FunnelDetails from 'Components/Funnels/FunnelDetails'; import FunnelIssueDetails from 'Components/Funnels/FunnelIssueDetails'; import { fetchList as fetchIntegrationVariables } from 'Duck/customField'; +import { fetchList as fetchSiteList } from 'Duck/site'; +import { fetchList as fetchAnnouncements } from 'Duck/announcements'; +import { fetchList as fetchAlerts } from 'Duck/alerts'; +import { fetchWatchdogStatus } from 'Duck/watchdogs'; import APIClient from './api_client'; import * as routes from './routes'; @@ -80,7 +84,14 @@ const ONBOARDING_REDIRECT_PATH = routes.onboarding(OB_DEFAULT_TAB); onboarding: state.getIn([ 'user', 'onboarding' ]) }; }, { - fetchUserInfo, fetchTenants, setSessionPath, fetchIntegrationVariables + fetchUserInfo, + fetchTenants, + setSessionPath, + fetchIntegrationVariables, + fetchSiteList, + fetchAnnouncements, + fetchAlerts, + fetchWatchdogStatus, }) class Router extends React.Component { state = { @@ -93,6 +104,14 @@ class Router extends React.Component { props.fetchUserInfo().then(() => { props.fetchIntegrationVariables() }), + props.fetchSiteList().then(() => { + setTimeout(() => { + props.fetchAnnouncements(); + props.fetchAlerts(); + props.fetchWatchdogStatus(); + }, 100); + }), + // props.fetchAnnouncements(), ]) // .then(() => this.onLoginLogout()); } diff --git a/frontend/app/components/Alerts/Notifications/Notifications.js b/frontend/app/components/Alerts/Notifications/Notifications.js index deb14b640..a30ad824f 100644 --- a/frontend/app/components/Alerts/Notifications/Notifications.js +++ b/frontend/app/components/Alerts/Notifications/Notifications.js @@ -18,9 +18,9 @@ class Notifications extends React.Component { constructor(props) { super(props); - setTimeout(() => { - props.fetchList(); - }, 1000); + // setTimeout(() => { + // props.fetchList(); + // }, 1000); setInterval(() => { props.fetchList(); diff --git a/frontend/app/components/Announcements/Announcements.js b/frontend/app/components/Announcements/Announcements.js index ff392e2e7..733b4ce37 100644 --- a/frontend/app/components/Announcements/Announcements.js +++ b/frontend/app/components/Announcements/Announcements.js @@ -10,11 +10,7 @@ import { withRouter } from 'react-router-dom'; @withToggle('visible', 'toggleVisisble') @withRouter class Announcements extends React.Component { - constructor(props) { - super(props); - props.fetchList(); - } - + navigateToUrl = url => { if (url) { if (url.startsWith(window.ENV.ORIGIN)) { diff --git a/frontend/app/components/BugFinder/BugFinder.js b/frontend/app/components/BugFinder/BugFinder.js index f0024c20a..6d30359f1 100644 --- a/frontend/app/components/BugFinder/BugFinder.js +++ b/frontend/app/components/BugFinder/BugFinder.js @@ -4,14 +4,11 @@ import withPageTitle from 'HOCs/withPageTitle'; import { fetchFavoriteList as fetchFavoriteSessionList } from 'Duck/sessions'; -import { countries } from 'App/constants'; import { applyFilter, clearEvents, addAttribute } from 'Duck/filters'; import { fetchList as fetchFunnelsList } from 'Duck/funnels'; -import { defaultFilters, preloadedFilters } from 'Types/filter'; import { KEYS } from 'Types/filter/customFilter'; import SessionList from './SessionList'; import stl from './bugFinder.css'; -import { fetchList as fetchSiteList } from 'Duck/site'; import withLocationHandlers from "HOCs/withLocationHandlers"; import { fetch as fetchFilterVariables } from 'Duck/sources'; import { fetchSources } from 'Duck/customField'; @@ -68,7 +65,6 @@ const allowedQueryKeys = [ fetchSources, clearEvents, setActiveTab, - fetchSiteList, fetchFunnelsList, resetFunnel, resetFunnelFilters, @@ -81,7 +77,6 @@ export default class BugFinder extends React.PureComponent { state = {showRehydratePanel: false} constructor(props) { super(props); - // props.fetchFavoriteSessionList(); // TODO should cache the response // props.fetchSources().then(() => { @@ -115,29 +110,6 @@ export default class BugFinder extends React.PureComponent { this.setState({ showRehydratePanel: !this.state.showRehydratePanel }) } - // fetchPreloadedFilters = () => { - // this.props.fetchFilterVariables('filterValues').then(function() { - // const { filterValues } = this.props; - // const keys = [ - // {key: KEYS.USER_OS, label: 'OS'}, - // {key: KEYS.USER_BROWSER, label: 'Browser'}, - // {key: KEYS.USER_DEVICE, label: 'Device'}, - // {key: KEYS.REFERRER, label: 'Referrer'}, - // {key: KEYS.USER_COUNTRY, label: 'Country'}, - // ] - // if (filterValues && filterValues.size != 0) { - // keys.forEach(({key, label}) => { - // const _keyFilters = filterValues.get(key) - // if (key === KEYS.USER_COUNTRY) { - // preloadedFilters.push(_keyFilters.map(item => ({label, type: key, key, value: item, actualValue: countries[item], isFilter: true}))); - // } else { - // preloadedFilters.push(_keyFilters.map(item => ({label, type: key, key, value: item, isFilter: true}))); - // } - // }) - // } - // }.bind(this)); - // } - setActiveTab = tab => { this.props.setActiveTab(tab); } diff --git a/frontend/app/components/BugFinder/DateRange.js b/frontend/app/components/BugFinder/DateRange.js index ed8c76c98..c0758b426 100644 --- a/frontend/app/components/BugFinder/DateRange.js +++ b/frontend/app/components/BugFinder/DateRange.js @@ -10,7 +10,7 @@ import DateRangeDropdown from 'Shared/DateRangeDropdown'; }) export default class DateRange extends React.PureComponent { onDateChange = (e) => { - this.props.fetchFunnelsList(e.rangeValue) + // this.props.fetchFunnelsList(e.rangeValue) this.props.applyFilter(e) } render() { diff --git a/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js b/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js index 2436d4be6..be98a28cd 100644 --- a/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js +++ b/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js @@ -22,9 +22,9 @@ function SessionsMenu(props) { } } - useEffect(() => { - fetchWatchdogStatus() - }, []) + // useEffect(() => { + // fetchWatchdogStatus() + // }, []) const capturingAll = props.captureRate && props.captureRate.get('captureAll'); diff --git a/frontend/app/components/Client/Client.js b/frontend/app/components/Client/Client.js index 6cae36710..cb55d933d 100644 --- a/frontend/app/components/Client/Client.js +++ b/frontend/app/components/Client/Client.js @@ -3,7 +3,6 @@ import { withRouter } from 'react-router-dom'; import { Switch, Route, Redirect } from 'react-router'; import { CLIENT_TABS, client as clientRoute } from 'App/routes'; import { fetchList as fetchMemberList } from 'Duck/member'; -import { fetchList as fetchSiteList } from 'Duck/site'; import ProfileSettings from './ProfileSettings'; import Integrations from './Integrations'; @@ -21,7 +20,6 @@ import Roles from './Roles'; appearance: state.getIn([ 'user', 'account', 'appearance' ]), }), { fetchMemberList, - fetchSiteList, }) @withRouter export default class Client extends React.PureComponent { diff --git a/frontend/app/components/Header/Header.js b/frontend/app/components/Header/Header.js index 38d958c17..6d541fca7 100644 --- a/frontend/app/components/Header/Header.js +++ b/frontend/app/components/Header/Header.js @@ -66,10 +66,6 @@ const Header = (props) => { } }, [showTrackingModal]) - useEffect(() => { - fetchSiteList() - }, []) - return (
diff --git a/frontend/app/components/shared/TrackerUpdateMessage/TrackerUpdateMessage.js b/frontend/app/components/shared/TrackerUpdateMessage/TrackerUpdateMessage.js index a5fe4411c..787751d79 100644 --- a/frontend/app/components/shared/TrackerUpdateMessage/TrackerUpdateMessage.js +++ b/frontend/app/components/shared/TrackerUpdateMessage/TrackerUpdateMessage.js @@ -1,18 +1,25 @@ -import React from 'react' +import React, { useEffect } from 'react' import { Icon } from 'UI' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom'; import { onboarding as onboardingRoute } from 'App/routes' import { withSiteId } from 'App/routes'; +import { isGreaterOrEqualVersion } from 'App/utils' const TrackerUpdateMessage= (props) => { - // const { site } = props; - const { site, sites, match: { params: { siteId } } } = props; + const [needUpdate, setNeedUpdate] = React.useState(false) + const { sites, match: { params: { siteId } } } = props; const activeSite = sites.find(s => s.id == siteId); - const hasSessions = !!activeSite && !activeSite.recorded; - const appVersionInt = parseInt(window.ENV.TRACKER_VERSION.split(".").join("")) - const trackerVersionInt = site.trackerVersion ? parseInt(site.trackerVersion.split(".").join("")) : 0 - const needUpdate = !hasSessions && appVersionInt > trackerVersionInt; + + useEffect(() => { + if (!activeSite || !activeSite.trackerVersion) return; + + const isLatest = isGreaterOrEqualVersion(activeSite.trackerVersion, window.ENV.TRACKER_VERSION); + if (!isLatest && activeSite.recorded) { + setNeedUpdate(true) + } + }, [activeSite]) + return needUpdate ? ( <> {( diff --git a/frontend/app/player/MessageDistributor/managers/AssistManager.ts b/frontend/app/player/MessageDistributor/managers/AssistManager.ts index 908add195..595cf3b3e 100644 --- a/frontend/app/player/MessageDistributor/managers/AssistManager.ts +++ b/frontend/app/player/MessageDistributor/managers/AssistManager.ts @@ -103,7 +103,7 @@ export default class AssistManager { if (document.hidden && getState().calling === CallingState.NoCall) { this.socket?.close() } - }, 15000) + }, 30000) } else { inactiveTimeout && clearTimeout(inactiveTimeout) this.socket?.open() diff --git a/frontend/app/utils.js b/frontend/app/utils.js index 52b2a9d6a..4c1a0c607 100644 --- a/frontend/app/utils.js +++ b/frontend/app/utils.js @@ -226,4 +226,10 @@ export const iceServerConfigFromString = (str) => { return server } }) +} + +export const isGreaterOrEqualVersion = (version, compareTo) => { + const [major, minor, patch] = version.split("-")[0].split('.'); + const [majorC, minorC, patchC] = compareTo.split("-")[0].split('.'); + return (major > majorC) || (major === majorC && minor > minorC) || (major === majorC && minor === minorC && patch >= patchC); } \ No newline at end of file diff --git a/frontend/env.js b/frontend/env.js index 1b1beb4bc..7d3ab7e6e 100644 --- a/frontend/env.js +++ b/frontend/env.js @@ -13,7 +13,7 @@ const oss = { ORIGIN: () => 'window.location.origin', API_EDP: () => 'window.location.origin + "/api"', ASSETS_HOST: () => 'window.location.origin + "/assets"', - VERSION: '1.5.1', + VERSION: '1.5.2', SOURCEMAP: true, MINIO_ENDPOINT: process.env.MINIO_ENDPOINT, MINIO_PORT: process.env.MINIO_PORT, diff --git a/scripts/helmcharts/init.sh b/scripts/helmcharts/init.sh index 428ed82eb..2df3b8450 100644 --- a/scripts/helmcharts/init.sh +++ b/scripts/helmcharts/init.sh @@ -15,7 +15,7 @@ fatal() exit 1 } -version="v1.5.1" +version="v1.5.2" usr=`whoami` # Installing k3s diff --git a/scripts/helmcharts/openreplay/Chart.yaml b/scripts/helmcharts/openreplay/Chart.yaml index 8057ec335..e621e543d 100644 --- a/scripts/helmcharts/openreplay/Chart.yaml +++ b/scripts/helmcharts/openreplay/Chart.yaml @@ -22,4 +22,4 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. # Ref: https://github.com/helm/helm/issues/7858#issuecomment-608114589 -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/alerts/Chart.yaml b/scripts/helmcharts/openreplay/charts/alerts/Chart.yaml index 885ad5503..0bfe8b4bc 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/assets/Chart.yaml b/scripts/helmcharts/openreplay/charts/assets/Chart.yaml index 75657b1df..9b8c32623 100644 --- a/scripts/helmcharts/openreplay/charts/assets/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/chalice/Chart.yaml b/scripts/helmcharts/openreplay/charts/chalice/Chart.yaml index 8de5927eb..1d0441f7e 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/db/Chart.yaml b/scripts/helmcharts/openreplay/charts/db/Chart.yaml index b0cdbebd4..0aa5f39e3 100644 --- a/scripts/helmcharts/openreplay/charts/db/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/db/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/ender/Chart.yaml b/scripts/helmcharts/openreplay/charts/ender/Chart.yaml index ec411fad1..8a7ce610e 100644 --- a/scripts/helmcharts/openreplay/charts/ender/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/ender/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/http/Chart.yaml b/scripts/helmcharts/openreplay/charts/http/Chart.yaml index 5b65ded45..5422d1f3d 100644 --- a/scripts/helmcharts/openreplay/charts/http/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/http/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/integrations/Chart.yaml b/scripts/helmcharts/openreplay/charts/integrations/Chart.yaml index f98a99254..e8fc92887 100644 --- a/scripts/helmcharts/openreplay/charts/integrations/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/integrations/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/nginx-ingress/Chart.yaml b/scripts/helmcharts/openreplay/charts/nginx-ingress/Chart.yaml index 75cf9a946..2c473b4b4 100644 --- a/scripts/helmcharts/openreplay/charts/nginx-ingress/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/nginx-ingress/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/sink/Chart.yaml b/scripts/helmcharts/openreplay/charts/sink/Chart.yaml index 51c85b6f3..7ece0a5bf 100644 --- a/scripts/helmcharts/openreplay/charts/sink/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/storage/Chart.yaml b/scripts/helmcharts/openreplay/charts/storage/Chart.yaml index 5b535bc5a..9e1c06d8c 100644 --- a/scripts/helmcharts/openreplay/charts/storage/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/storage/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/openreplay/charts/utilities/Chart.yaml b/scripts/helmcharts/openreplay/charts/utilities/Chart.yaml index 895405214..acc73d941 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/Chart.yaml +++ b/scripts/helmcharts/openreplay/charts/utilities/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -AppVersion: "v1.5.1" +AppVersion: "v1.5.2" diff --git a/scripts/helmcharts/vars.yaml b/scripts/helmcharts/vars.yaml index e7f59ab13..ed0ab4c05 100644 --- a/scripts/helmcharts/vars.yaml +++ b/scripts/helmcharts/vars.yaml @@ -1,4 +1,4 @@ -fromVersion: "v1.5.1" +fromVersion: "v1.5.2" # Databases specific variables postgresql: &postgres # For generating passwords diff --git a/utilities/servers/websocket.js b/utilities/servers/websocket.js index ab6a2c4d5..dfce5b4d7 100644 --- a/utilities/servers/websocket.js +++ b/utilities/servers/websocket.js @@ -161,7 +161,7 @@ module.exports = { wsRouter, start: (server) => { io = _io(server, { - maxHttpBufferSize: 1e6, + maxHttpBufferSize: 5e6, cors: { origin: "*", methods: ["GET", "POST", "PUT"]