From ae0f88299a10b30cafcb7a7c7f553095b17be66d Mon Sep 17 00:00:00 2001 From: Alexey Kontsevoy Date: Thu, 27 Jun 2019 14:53:41 -0400 Subject: [PATCH 1/2] Fix regression bug with active sessions --- web/Dockerfile | 7 +++--- .../app/flux/sessions/activeSessionStore.js | 22 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 12b557dc4b8af..a2d849c347be8 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,8 +1,9 @@ FROM node:8.11.2-slim -RUN apt-get update && apt-get install -y python python-dev python-pip - -RUN npm i npm@6.1.0 -g +# Fixes jessie repository +RUN sed -i '/jessie-updates/d' /etc/apt/sources.list +RUN apt-get update && apt-get install git -y && apt-get install -y python python-dev python-pip +RUN npm i npm@6.4.1 -g # prepare to install only package.json dependencies RUN mkdir -p /app diff --git a/web/src/app/flux/sessions/activeSessionStore.js b/web/src/app/flux/sessions/activeSessionStore.js index 701d7463eb750..9361dfd40ee17 100644 --- a/web/src/app/flux/sessions/activeSessionStore.js +++ b/web/src/app/flux/sessions/activeSessionStore.js @@ -19,16 +19,15 @@ import { Record, List } from 'immutable'; import { RECEIVE_ACTIVE_SESSIONS } from './actionTypes'; -const ActiveSessionRec = Record({ +const ActiveSessionRec = Record({ id: undefined, - namespace: undefined, + namespace: undefined, login: undefined, - active: undefined, created: undefined, last_active: undefined, server_id: undefined, siteId: undefined, - parties: List() + parties: List() }) const PartyRecord = Record({ @@ -37,14 +36,14 @@ const PartyRecord = Record({ serverId: undefined }) -const defaultState = () => toImmutable({}); +const defaultState = () => toImmutable({}); export default Store({ getInitialState() { return defaultState(); }, - initialize() { + initialize() { this.on(RECEIVE_ACTIVE_SESSIONS, receive); } }) @@ -54,14 +53,13 @@ function receive(state, { siteId, json }) { const jsonArray = json || []; const newState = defaultState().withMutations(newState => jsonArray - .filter(item => item.active === true) .forEach(item => { const rec = createSessionRec(siteId, item); newState.set(rec.id, rec); }) ); - - return newState.equals(state) ? state : newState; + + return newState.equals(state) ? state : newState; } function createSessionRec(siteId, json) { @@ -77,9 +75,9 @@ function createSessionRec(siteId, json) { function createParties(jsonArray) { jsonArray = jsonArray || []; - const list = new List(); + const list = new List(); return list.withMutations(list => { - jsonArray.forEach(item => { + jsonArray.forEach(item => { const party = new PartyRecord({ user: item.user, serverIp: item.remote_addr, @@ -88,5 +86,5 @@ function createParties(jsonArray) { list.push(party) }) - }) + }) } From 5755a740af3f6272269ce20c7c9e2a9b19c3040b Mon Sep 17 00:00:00 2001 From: Alexey Kontsevoy Date: Thu, 27 Jun 2019 15:17:47 -0400 Subject: [PATCH 2/2] dist and e-ref --- e | 2 +- ...p.1d3783820436ca0292c1.js => app.24a060de91be02b343c3.js} | 5 +---- ...d3783820436ca0292c1.js => styles.24a060de91be02b343c3.js} | 0 ...d3783820436ca0292c1.js => vendor.24a060de91be02b343c3.js} | 2 +- web/dist/index.html | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) rename web/dist/app/{app.1d3783820436ca0292c1.js => app.24a060de91be02b343c3.js} (99%) rename web/dist/app/{styles.1d3783820436ca0292c1.js => styles.24a060de91be02b343c3.js} (100%) rename web/dist/app/{vendor.1d3783820436ca0292c1.js => vendor.24a060de91be02b343c3.js} (99%) diff --git a/e b/e index 6378c77b17222..8fb0b68990572 160000 --- a/e +++ b/e @@ -1 +1 @@ -Subproject commit 6378c77b17222f942ccd5db40baeb627dd017b66 +Subproject commit 8fb0b689905727df197f734675c412fbe6565d48 diff --git a/web/dist/app/app.1d3783820436ca0292c1.js b/web/dist/app/app.24a060de91be02b343c3.js similarity index 99% rename from web/dist/app/app.1d3783820436ca0292c1.js rename to web/dist/app/app.24a060de91be02b343c3.js index c8c7d7b581558..dacada840cb4e 100644 --- a/web/dist/app/app.1d3783820436ca0292c1.js +++ b/web/dist/app/app.24a060de91be02b343c3.js @@ -21846,7 +21846,6 @@ webpackJsonp([0],[ id: undefined, namespace: undefined, login: undefined, - active: undefined, created: undefined, last_active: undefined, server_id: undefined, @@ -21880,9 +21879,7 @@ webpackJsonp([0],[ var jsonArray = json || []; var newState = defaultState().withMutations(function (newState) { - return jsonArray.filter(function (item) { - return item.active === true; - }).forEach(function (item) { + return jsonArray.forEach(function (item) { var rec = createSessionRec(siteId, item); newState.set(rec.id, rec); }); diff --git a/web/dist/app/styles.1d3783820436ca0292c1.js b/web/dist/app/styles.24a060de91be02b343c3.js similarity index 100% rename from web/dist/app/styles.1d3783820436ca0292c1.js rename to web/dist/app/styles.24a060de91be02b343c3.js diff --git a/web/dist/app/vendor.1d3783820436ca0292c1.js b/web/dist/app/vendor.24a060de91be02b343c3.js similarity index 99% rename from web/dist/app/vendor.1d3783820436ca0292c1.js rename to web/dist/app/vendor.24a060de91be02b343c3.js index ec4724f79e1c6..d55b1d2acbc2d 100644 --- a/web/dist/app/vendor.1d3783820436ca0292c1.js +++ b/web/dist/app/vendor.24a060de91be02b343c3.js @@ -1,4 +1,4 @@ -!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n=window.webpackJsonp;window.webpackJsonp=function(o,a){for(var s,u,l=0,c=[];l
- +