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 1fTh5z-0007ew-9m for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jun 2018 05:16:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fTh5y-000899-0k for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jun 2018 05:16:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTh5x-00088z-KE for pgadmin-hackers@lists.postgresql.org; Fri, 15 Jun 2018 05:16:21 +0000 Received: from mail-ot0-x22b.google.com ([2607:f8b0:4003:c0f::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fTh5t-0006cx-PA for pgadmin-hackers@postgresql.org; Fri, 15 Jun 2018 05:16:19 +0000 Received: by mail-ot0-x22b.google.com with SMTP id v24-v6so1167991otk.13 for ; Thu, 14 Jun 2018 22:16:17 -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=vgFNsz+oPvm9TmICvavkaVmwl2ZbcN4xb3l6HuidfTU=; b=Wtlq+NiJqbvnxBwcD7Ku6LqQONkKYNhibEJz54ESCDp3j8jkS4YFajxjRPKUSWPf2s dPAQw9yuI6HDZtdqJbsfGWGhaK5aIEGA7C5LJYqKoHZdPrf6b6v7ATJed23zBJrV7xEa 8aF9VhgxUYR4p5bfc4x5uH/8tpncDWCikziiZ4iDSVEJy7FwnpetB0K3Y0OrcVKvC7Ma cZJEYoQIuu7Q9I55VnPeBxtTF+5yA8uNlNs19EmTLfbhuqPjpsPv3OLXr4EK2wqRq2rX fHFLdIm17UizUimM/THrCCSMZgZ0eCkqe35+G1fcd2lSS/gIUldMS1kLHuh47IuTvErH D3OA== 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=vgFNsz+oPvm9TmICvavkaVmwl2ZbcN4xb3l6HuidfTU=; b=JpvBR7y7tFFpRJ+XdLLiDNAe96pgzN43E4iOkM08pFzwmBM3mE9VP5zbqXxm5ylNGH BaRJt+QxfIvg4dGB3jSMC7/T2oHaxSLmK8Jr4YGh3afsUAiwZtSJ7/Qdnq+EYpq70Xbt +n11d7C2Hpju5/oeAfeUR/Wj/ODPdwpdt/gHy0LJK0/nrJOwGrhEBZrhno0FqG68veUh 0f2mcFqJikOXm20XVTEkJ5vn7gI1rLx7tRJCOhRw1CiyyMKJb74FcTe19U5RqDIapg4R Fxf7D6E6WuYUp03fd/n4/nshO1EirwW6JlVz1+NR9rew8J8GN/sTEtx4cTnACLU6JJgT CmTQ== X-Gm-Message-State: APt69E3W3OJmMUHsDHQ9Z5wN/q2DY5poqHJ87gymIkuxKN+SgE5mG9tv NNvKhqx5b1vDCTgShcCUa0sx0+NijgMVg0GTurTQ3g== X-Google-Smtp-Source: ADUXVKKZu0WAMoiE/i5r2Akcjj2+uPh9mvIl6UgEVoRZKNFySjYo4u7c6bZidxMghc7i7oV5IrAQDp4RiyaKwyVe9B4= X-Received: by 2002:a9d:2010:: with SMTP id n16-v6mr95131ota.275.1529039776932; Thu, 14 Jun 2018 22:16:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:4081:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 22:16:16 -0700 (PDT) In-Reply-To: References: From: Khushboo Vashi Date: Fri, 15 Jun 2018 10:46:16 +0530 Message-ID: Subject: Re: RM#3294 - User need to reset the layout to see the changed preferences parameters To: Aditya Toshniwal Cc: Victoria Henry , Harshal Dhumal , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000c077c8056ea750f9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c077c8056ea750f9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 14, 2018 at 6:54 PM, Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > 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 w= ork >>>>> properly on different browsers. >>>>> >>>> To communicate between browser tabs we can use cookie polling on clien= t >>>> side it self (at least it will avoid polling over http). >>>> The main tab will update only preference specific cookie when >>>> preference is updated and other tabs will poll required cookies (not a= ll) >>>> 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 = events.=E2=80=8B > cache_preferences is called whenever preferences are changed. I suggest w= e > 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= of > prefcache it is having. When the main window changes the preferences and > cache_preference is called, the prefcache_version will increase to curren= t > epoch time. New tab polling can check if the version has increased and ca= n > update =E2=80=8Bits preferences along with prefcache_version. > > Sounds good to me. > =E2=80=8BPlease let me know if any suggestions.=E2=80=8B > > >> Thanks >> Victoria & Joao >> > > > > -- > Thanks and Regards, > Aditya Toshniwal > Software Engineer | EnterpriseDB Software Solutions | Pune > "Don't Complain about Heat, Plant a tree" > --000000000000c077c8056ea750f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Jun 14, 2018 at 6:54 PM, Aditya Toshniwal <= ;adi= tya.toshniwal@enterprisedb.com> wrote:
Hi Victoria/Hackers,

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


It is not possible to fire event in another tab/n= ew browser window. For example, query tool can be open in another tab. And = thus, changes are not reflected there. There are solutions available like u= pdating the localStorage of the browser but those are not reliable and does= not work 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 preference is updated= and other tabs will poll required cookies (not all)
with specifi= c interval (1 second can be configurable).
Polling is a solution but I think it should be the last option. ht= tp polls will not be required anyway as we have preference cache in the bro= wser object.
=C2=A0
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 backen= d that something changed during the poll?
=C2=A0
=E2=80=8BCurrently I am using the cache_preferences function to= fire the events.=E2=80=8B cache_preferences is called whenever preferences= are changed. I suggest we add kind of version for the preference cache, le= ts say prefcache_version and we can set it to current epoch time whenever t= he cache_preference is called.
=E2=80=8B
=E2=80=8B Now, when a new tab/window is opened, it will store the versio= n of prefcache it is having. When the main window changes the preferences a= nd cache_preference is called, the prefcache_version will increase to curre= nt epoch time. New tab polling can check if the version has increased and c= an update =E2=80=8Bits preferences along with prefcache_version.

=
Sounds good to me.=C2=A0
=
=E2=80=8BPlease let me know i= f any suggestions.=E2=80=8B

<= div dir=3D"ltr">

Thanks
=
Victoria & Joao



--
Thanks and Regards,
Aditya Toshniwal<= /span>
Software Engin= eer |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don&#= 39;t Complain about Heat, Plant a tree"

--000000000000c077c8056ea750f9--