Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTSF6-0000Fr-DG for pgadmin-hackers@arkaria.postgresql.org; Thu, 14 Jun 2018 13:24:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fTSF5-0005F9-Fc for pgadmin-hackers@arkaria.postgresql.org; Thu, 14 Jun 2018 13:24:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTSEX-0003rp-VF for pgadmin-hackers@lists.postgresql.org; Thu, 14 Jun 2018 13:24:14 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fTSET-00066y-0W for pgadmin-hackers@postgresql.org; Thu, 14 Jun 2018 13:24:12 +0000 Received: by mail-lf0-x234.google.com with SMTP id t2-v6so3005865lfd.6 for ; Thu, 14 Jun 2018 06:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MZ5vc8fNSw9rjDMiGCG9wFo2ccVI8xbJ1gfXAh20y8E=; b=DyfGy3d2SOXtvxk1Q7v575iqAsKHQ5QXgGc3cwtcyRbaFHLz1prLHQ8PyvwuC/IEij p3g6j+JXmBdcnRPMxl+CTFFaqWNeG55UtDDt9Zj0q32aZI4YceJHSHTfPhLEYGgxVWqv drHS/jghZ3cFXt6t/RDk8dit5qr+ZHxK6W5voNLPh5qpwh0L9PTSjNfu+Ktwy644vt4M /eslbvqlpJjmBEhg7tRRGh3Da6EiCic0sQSkpPqIvcy8Xky+q4zSkDC9n3HFmsMO//xP oUYJiiBjcIbY6JQV364oXJN+SOUiVVO62ztYMK2LuIR002E1Cg2iF5P8ieYY0AJgb5pf rBKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MZ5vc8fNSw9rjDMiGCG9wFo2ccVI8xbJ1gfXAh20y8E=; b=Uxkho2AZZyVf55/pE0mYhyPeT4CMGPamQheBZCWJXfiBmDHiy8aDkltz70tDM3lZvL w6HX3IPyxT8jqrYhPfX+L9H+JpuKb7yQQA+S+eqGhhfG/Uu8n+ZtMXLQrlUzerQ9PQZd vl/dIw8Y56yyH67IME/E3Jbzoba8qlSXDM2UDHOisHjTPF9mvNr6e2hkVPrKtgqhRBu5 9QJPTxuXanl5NNCjZwPC7gHk0UkZxtkadTm6vossO1W7rRra1diDNrLNS1wPbJ/lsN+i RYu62vM3j+VQ4ObUWS83pDsyypYwYti9eKWOZpr3SOxS+iK5zsKRSxsrYffQizQ8THiz sJWQ== X-Gm-Message-State: APt69E23BBW+wnpOvcAUBt1aURGyRddwjgcY1BPulIhKF1QTJqCpvndA dxEC8bIZJ0KjHuGO6GSD14w70Rj03GCikl24M+x/1A== X-Google-Smtp-Source: ADUXVKJhJsUDNTJ5wmjRW7+rt0J6JSU0bZdAkHzuYFxNMN4k5AxtN7LrcR6vdYac4jJYucKAt215o383D9Ke4S0LQsc= X-Received: by 2002:a19:7:: with SMTP id 7-v6mr6327979lfa.62.1528982647982; Thu, 14 Jun 2018 06:24:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:7a02:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 06:24:07 -0700 (PDT) In-Reply-To: References: From: Aditya Toshniwal Date: Thu, 14 Jun 2018 18:54:07 +0530 Message-ID: Subject: Re: RM#3294 - User need to reset the layout to see the changed preferences parameters To: Victoria Henry Cc: Harshal Dhumal , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000099e15b056e9a039f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000099e15b056e9a039f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Victoria/Hackers, On Tue, Jun 12, 2018 at 9:52 PM, Victoria Henry wrote: > Hi Aditya, > > > It is not possible to fire event in another tab/new browser window. For >>>> example, query tool can be open in another tab. And thus, changes are = not >>>> reflected there. There are solutions available like updating the >>>> localStorage of the browser but those are not reliable and does not wo= rk >>>> properly on different browsers. >>>> >>> To communicate between browser tabs we can use cookie polling on client >>> side it self (at least it will avoid polling over http). >>> The main tab will update only preference specific cookie when preferenc= e >>> is updated and other tabs will poll required cookies (not all) >>> with specific interval (1 second can be configurable). >>> >> Polling is a solution but I think it should be the last option. http >> polls will not be required anyway as we have preference cache in the >> browser object. >> > > Maybe it's better to poll only when an editor is open in a separate > window? What would we be polling for and how would be tell the backend > that something changed during the poll? > =E2=80=8BCurrently I am using the cache_preferences function to fire the ev= ents.=E2=80=8B cache_preferences is called whenever preferences are changed. I suggest we add kind of version for the preference cache, lets say prefcache_version and we can set it to current epoch time whenever the cache_preference is called. =E2=80=8B =E2=80=8B Now, when a new tab/window is opened, it will store the version o= f prefcache it is having. When the main window changes the preferences and cache_preference is called, the prefcache_version will increase to current epoch time. New tab polling can check if the version has increased and can update =E2=80=8Bits preferences along with prefcache_version. =E2=80=8BPlease let me know if any suggestions.=E2=80=8B > Thanks > Victoria & Joao > --=20 Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB Software Solutions | Pune "Don't Complain about Heat, Plant a tree" --00000000000099e15b056e9a039f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Victoria/Hackers,

On Tue, Jun 12, 2018 at 9:52 PM, Victoria Henry <vhen= ry@pivotal.io> wrote:
Hi Aditya,


It is not possible to fire event in another tab/= new browser window. For example, query tool can be open in another tab. And= thus, changes are not reflected there. There are solutions available like = updating the localStorage of the browser but those are not reliable and doe= s not work properly on different browsers.
<= div>To communicate between browser tabs we can use cookie polling on client= side it self (at least it will avoid polling over http).
The mai= n tab will update only preference specific cookie when preference is update= d and other tabs will poll required cookies (not all)
with specif= ic interval (1 second can be configurable).
Polling is a solution but I think it should be the last option. h= ttp polls will not be required anyway as we have preference cache in the br= owser object.
=C2=A0
<= div>Maybe it's better to poll only when an editor is open in a separate= window?=C2=A0 What would we be polling for and how would be tell the backe= nd that something changed during the poll?
=C2=A0
=E2=80=8BCurrently I am using the cache_prefe= rences function to fire the events.=E2=80=8B cache_preferences is called wh= enever preferences are changed. I suggest we add kind of version for the pr= eference cache, lets say prefcache_version and we can set it to current epo= ch time whenever the cache_preference is called.
=E2=80=8B
=E2=80=8B Now, when a new tab/= window is opened, it will store the version of prefcache it is having. When= the main window changes the preferences and cache_preference is called, th= e prefcache_version will increase to current epoch time. New tab polling ca= n check if the version has increased and can update =E2=80=8Bits preference= s along with prefcache_version.

=E2=80=8BPlease= let me know if any suggestions.=E2=80=8B


Thanks
Victoria & Joao



--
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Software Sol= utions |=C2=A0Pune
"Don't Complain about Heat, Plant a tr= ee"
--00000000000099e15b056e9a039f--