8

automated refresh if viewed data changes

this has come up in the studio recently

ie "why doesn't Shotgun update my view if I just leave the tab open" type thing since that is in line with how people expect other apps to work

I'm sure there are very good reasons for SG requiring a user initiated refresh to update view data but I was wondering if there was any way to do this on the client side using javascript that would do something like:


  • cache all entity id's used in the current view set (refresh cache when page refreshes)
  • also cache all entity ids' that might also be used to create the current data set via linked relations (this bit is much harder I guess - could this sort of info be returned with the page query somehow? - or is there some smarter way to work this out?)
  • listen to the event queue on the server (say every few minutes)
  • if any of the cached ids appear in the event queue (eg on update) then refresh the page (or do some smarter ajax thingy inline if this is possible)
I'm sure there's potentially more to this than I am realising (eg what happens if new entities are created that potentially affect the current view set for example) but even some limited subset of this sort of thing would be useful -

eg even an 'auto-update if new entities that would be returned by the current page query are created, or,  currently shown entities are directly updated" would be great for things like watching notes come in and so on

 

4 comments

  • 0
    Avatar
    Stu Aitken

    on another thread I saw this:

    "It seems that Shotgun refreshes the page anyway at certain intervals so this would just be a trigger to refresh it early. that's it :)"


    is this true?  if so maybe the solution would be just to give the site admin some control over how regularly this happens? (and maybe with some sort of check for any open forms so that its just refreshing view data and not an active form in the FG)

  • 0
    Avatar
    Ben Hadden

    Hi Stu,

    In our latest release (Shotgun 5.0), we have redesigned the detail pages so they auto-refresh. For example, if you leave a Shot detail page open in a tab, we'll continue to load new notes, versions, publishes, and interesting events on that shot into its "activity stream". We're not doing this in our legacy views (embedded list pages), but our newest features like the Inbox, My Tasks, and the Overview tab on detail pages all now auto-refresh. Once you upgrade your site to 5.0, let us know what you think!

    Cheers,
    Ben

  • 0
    Avatar
    Stu Aitken

    thanks Ben - this is good to know and will hopefully satisfy some of the more refresh-o-phobic members of the team :)

  • 1
    Avatar
    Maxim Doucet

    (voting for your request and adding information from my original ticket as suggested by Brandon Foster from the support team)

    Hi,

    Our artists also often have the case where the status of an asset/task/etc. is modified but the artists/managers won't see the change until they refresh their browser.

    I have heard about technologies like http://crossbar.io:

    Crossbar.io is an application router which implements the Web Application Messaging Protocol (WAMP). WAMP provides asynchronous Remote Procedure Calls and Publish & Subscribe (with WebSocket being one transport option) and allows to connect application components in distributed systems

    More info on WAMP at http://wamp.ws

    Coupled with python/django on server side, it would allow our browsers, registered as WAMP clients to be refreshed whenever there is an event emitted by the shotgun server.

    crossbar.io only acts here as the hub/router which knows who are the clients (the artists's browsers) and which event they should receive from the shotgun server.

    Or I probably talk too much about the tools and the implementation whereas your team probably have some ideas on an easier way to force the refresh on the artists's browsers :)

    Anyway, could you track this as a feature request?

    Thank you for your help and best regards,
    Maxim Doucet - CIO at Digital District / Fix Studio

Please sign in to leave a comment.